Largest Square Submatrix of all 1's Haha Expert

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 listSep 15, 2026 00:34Josu San MartinJosu San MartinScore: 80,670Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 15, 2026 00:3574,13738,420,19125,209,0004,446,0002,117,632
2Sep 15, 2026 00:3574,25738,415,24925,396,0004,307,0002,117,632
3Sep 15, 2026 00:3579,50540,555,34327,501,0004,301,0002,117,632
4Sep 15, 2026 00:3580,25240,659,69427,801,0004,300,0002,117,632
5Sep 15, 2026 00:3580,67041,021,32827,936,0004,332,0002,117,632
6Sep 15, 2026 00:3580,90741,129,77728,081,0004,282,0002,117,632
7Sep 15, 2026 00:3581,28042,423,03928,304,0004,208,0002,117,632
8Sep 15, 2026 00:3581,65741,394,29528,345,0004,318,0002,117,632
9Sep 15, 2026 00:3582,21041,540,83528,573,0004,311,0002,117,632