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 21:06M-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 21:07015,679,9623,459,0001,106,0002,121,728expected "60", got "50 "
2May 22, 2026 21:0711,36513,817,2773,486,0001,060,0002,121,728
3May 22, 2026 21:0711,43015,574,3473,520,0001,052,0002,121,728
4May 22, 2026 21:0711,44514,637,7993,484,0001,094,0002,121,728
5May 22, 2026 21:0711,46514,381,9393,521,0001,065,0002,121,728
6May 22, 2026 21:0711,47214,692,6753,498,0001,091,0002,121,728
7May 22, 2026 21:0711,52516,241,5893,528,0001,082,0002,121,728
8May 22, 2026 21:0711,58521,983,0703,530,0001,104,0002,121,728
9May 22, 2026 21:0711,60217,096,2043,586,0001,055,0002,121,728