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 20, 2026 17:45M-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 20, 2026 17:47018,976,0806,519,0001,109,0002,121,728expected "52", got "50 "
2May 20, 2026 17:47018,998,3136,500,0001,101,0002,121,728expected "50", got "49 "
3May 20, 2026 17:4718,83216,940,1016,450,0001,083,0002,121,728
4May 20, 2026 17:4718,88518,218,8996,478,0001,076,0002,121,728
5May 20, 2026 17:4718,95717,472,7816,483,0001,100,0002,121,728
6May 20, 2026 17:4718,96217,653,7566,502,0001,083,0002,121,728
7May 20, 2026 17:4718,97219,147,8496,519,0001,070,0002,121,728
8May 20, 2026 17:4719,33017,511,5966,642,0001,090,0002,121,728
9May 20, 2026 17:4719,37017,504,3436,661,0001,087,0002,121,728