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 listDec 2, 2026 07:31Dominique GarmierDominique GarmierScore: 2,795Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 2, 2026 07:322,3428,720,814937,00002,117,632
2Dec 2, 2026 07:322,4958,732,366998,00002,117,632
3Dec 2, 2026 07:322,7059,177,5181,082,00002,117,632
4Dec 2, 2026 07:322,7929,028,5341,117,00002,117,632
5Dec 2, 2026 07:322,7958,885,9951,118,00002,117,632
6Dec 2, 2026 07:323,1059,304,4521,242,00002,117,632
7Dec 2, 2026 07:323,14710,959,2191,259,00002,117,632
8Dec 2, 2026 07:323,3459,104,1291,338,00002,117,632
9Dec 2, 2026 07:323,6279,268,3671,451,00002,117,632