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 16, 2026 13:47M-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 16, 2026 13:48021,528,0267,950,0002,231,0002,121,728expected "50", got "49 "
2May 16, 2026 13:4824,91018,838,4147,777,0002,187,0002,121,728
3May 16, 2026 13:4825,04020,628,8367,817,0002,199,0002,121,728
4May 16, 2026 13:4825,10019,097,8107,823,0002,217,0002,117,632
5May 16, 2026 13:4825,15520,499,5897,868,0002,194,0002,113,536
6May 16, 2026 13:4825,29519,569,2047,894,0002,224,0002,121,728
7May 16, 2026 13:4825,35719,595,8867,908,0002,235,0002,117,632
8May 16, 2026 13:4825,45519,069,2297,948,0002,234,0002,121,728
9May 16, 2026 13:4825,60520,856,5168,005,0002,237,0002,121,728