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 listApr 26, 2026 00:08Charles CabergsCharles CabergsScore: 150,867Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 26, 2026 00:10147,07079,293,55322,933,00035,895,0002,523,136stderr
2Apr 26, 2026 00:10147,26274,292,84227,955,00030,950,0002,519,040stderr
3Apr 26, 2026 00:10148,08573,750,22728,111,00031,123,0002,510,848stderr
4Apr 26, 2026 00:10148,21273,743,05629,140,00030,145,0002,318,336stderr
5Apr 26, 2026 00:10150,86774,128,95331,179,00029,168,0002,514,944stderr
6Apr 26, 2026 00:10152,59582,760,63530,019,00031,019,0002,514,944stderr
7Apr 26, 2026 00:10154,87081,748,66630,974,00030,974,0002,514,944stderr
8Apr 26, 2026 00:10157,55285,341,29324,008,00039,013,0002,514,944stderr
9Apr 26, 2026 00:10159,42780,633,17332,882,00030,889,0002,318,336stderr