Largest Square Submatrix of all 1's C#_user

Find the largest square submatrix consisting entirely of 1s as fast as possible.

Input

A 10,000 x 10,000 matrix of uint8 values (0 or 1) on STDIN.

0, 1, 0, 1, 1
0, 1, 1, 1, 1
0, 0, 1, 0, 0
1, 0, 1, 1, 0

Output

Print the side length of the largest all-ones square submatrix to STDOUT. The answer is guaranteed to be greater than 1.

For the example above, the output is:

2
Back to listAug 15, 2026 16:27Victor MerckléVictor MerckléScore: 9,270Success
Source Code

Source code access is restricted. Log in to request access.

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 15, 2026 16:293,3129,174,5711,325,00002,117,632stderr
2Aug 15, 2026 16:293,6979,342,14501,479,0002,117,632stderr
3Aug 15, 2026 16:297,30011,689,9171,460,0001,460,0002,117,632stderr
4Aug 15, 2026 16:298,04511,974,3191,609,0001,609,0002,117,632stderr
5Aug 15, 2026 16:299,27012,446,5901,854,0001,854,0002,117,632stderr
6Aug 15, 2026 16:2910,06511,937,9671,297,0002,729,0002,117,632stderr
7Aug 15, 2026 16:2916,58714,759,9833,317,0003,318,0002,117,632stderr
8Aug 15, 2026 16:2917,14215,402,6043,428,0003,429,0002,117,632stderr
9Aug 15, 2026 16:2917,36515,750,0283,473,0003,473,0002,117,632stderr