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 listOct 16, 2026 21:48janwwwjanwwwScore: 3,350Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 16, 2026 21:493,07211,346,1331,229,00002,117,632
2Oct 16, 2026 21:493,18511,355,1221,274,00002,117,632
3Oct 16, 2026 21:493,22711,228,8441,291,00002,117,632
4Oct 16, 2026 21:493,25211,360,3461,301,00002,117,632
5Oct 16, 2026 21:493,35011,298,0521,340,00002,117,632
6Oct 16, 2026 21:493,43211,448,6381,373,00002,117,632
7Oct 16, 2026 21:493,52011,485,6131,408,00002,117,632
8Oct 16, 2026 21:493,59711,393,0881,439,00002,117,632
9Oct 16, 2026 21:493,66011,457,0491,464,00002,117,632