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 11, 2026 08:00janwwwjanwwwScore: 3,410Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 11, 2026 08:013,2579,946,0291,303,00002,117,632
2Oct 11, 2026 08:013,28010,066,6851,312,00002,117,632
3Oct 11, 2026 08:013,30211,018,3901,321,00002,117,632
4Oct 11, 2026 08:013,38710,268,4001,355,00002,117,632
5Oct 11, 2026 08:013,41010,564,4361,364,00002,117,632
6Oct 11, 2026 08:013,53510,714,1801,414,00002,117,632
7Oct 11, 2026 08:013,55010,693,8471,420,00002,117,632
8Oct 11, 2026 08:013,60012,178,7901,440,00002,117,632
9Oct 11, 2026 08:014,05010,386,44201,620,0002,117,632