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 22, 2026 20:58M-RochatM-RochatError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 22, 2026 20:59021,132,2337,486,0001,233,0002,121,728expected "56", got "50 "
2May 22, 2026 20:5921,70719,326,4497,565,0001,118,0002,121,728
3May 22, 2026 20:5921,99718,551,4367,676,0001,123,0002,121,728
4May 22, 2026 20:5922,02720,331,4457,697,0001,114,0002,121,728
5May 22, 2026 20:5922,11719,214,4367,591,0001,256,0002,121,728
6May 22, 2026 20:5922,25020,123,7787,834,0001,066,0002,121,728
7May 22, 2026 20:5922,25020,401,2557,858,0001,042,0002,121,728
8May 22, 2026 20:5922,28718,981,8077,803,0001,112,0002,121,728
9May 22, 2026 20:5922,52018,496,8537,951,0001,057,0002,121,728