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 5, 2026 13:11Victor MerckléVictor MerckléScore: 7,795Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 5, 2026 13:134,72220,231,1251,889,00002,363,392
2May 5, 2026 13:137,02520,231,6241,383,0001,427,0002,355,200
3May 5, 2026 13:137,58719,760,6751,510,0001,525,0002,363,392
4May 5, 2026 13:137,67521,965,2701,415,0001,655,0002,363,392
5May 5, 2026 13:137,79517,751,4681,494,0001,624,0002,359,296
6May 5, 2026 13:137,86017,125,9651,498,0001,646,0002,351,104
7May 5, 2026 13:138,07217,096,7341,476,0001,753,0002,359,296
8May 5, 2026 13:138,34721,047,5651,498,0001,841,0002,342,912
9May 5, 2026 13:138,49218,173,5521,552,0001,845,0002,351,104