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 9, 2026 15:43Aleksei ShahoikaAleksei ShahoikaScore: 582,985Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 9, 2026 15:44582,765250,297,314232,089,0001,017,0002,568,192
2May 9, 2026 15:44582,830251,199,535232,105,0001,027,0002,310,144
3May 9, 2026 15:44582,890251,572,549232,124,0001,032,0002,293,760
4May 9, 2026 15:44582,970249,671,703232,092,0001,096,0002,301,952
5May 9, 2026 15:44582,985247,802,178232,109,0001,085,0002,301,952
6May 9, 2026 15:44583,030248,845,189232,111,0001,101,0002,318,336
7May 9, 2026 15:44583,077252,497,664232,109,0001,122,0002,306,048
8May 9, 2026 15:44583,112251,103,305232,118,0001,127,0002,306,048
9May 9, 2026 15:44583,155249,073,744232,239,0001,023,0002,301,952