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 5, 2026 03:15olliecrowolliecrowError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 5, 2026 03:17015,441,50102,748,0002,482,176expected "75", got "50"
2May 5, 2026 03:17018,156,18602,814,0002,490,368expected "98", got "50"
3May 5, 2026 03:176,52217,285,67402,609,0002,494,464
4May 5, 2026 03:176,62215,822,85002,649,0002,502,656
5May 5, 2026 03:176,82717,818,83202,731,0002,478,080
6May 5, 2026 03:177,02517,606,64702,810,0002,490,368
7May 5, 2026 03:177,14020,455,7031,316,0001,540,0002,486,272
8May 5, 2026 03:177,14717,436,16802,859,0002,490,368
9May 5, 2026 03:177,23217,308,95302,893,0002,494,464