Largest Square Submatrix of all 1's NoSIMD_C#

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 listMay 6, 2026 15:33olliecrowolliecrowError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 6, 2026 15:34016,640,5101,746,00002,486,272expected "59", got "50"
2May 6, 2026 15:34016,904,1031,697,00002,494,464expected "73", got "50"
3May 6, 2026 15:344,04220,559,4511,617,00002,486,272
4May 6, 2026 15:344,14519,633,5031,658,00002,486,272
5May 6, 2026 15:344,22717,650,6971,691,00002,486,272
6May 6, 2026 15:344,32014,938,0051,728,00002,486,272
7May 6, 2026 15:344,41519,901,0801,766,00002,486,272
8May 6, 2026 15:344,49217,491,9611,797,00002,490,368
9May 6, 2026 15:344,57016,046,0341,828,00002,490,368