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 listNov 30, 2026 21:53Dominique GarmierDominique GarmierScore: 5,640Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 30, 2026 21:545,37511,575,6831,033,0001,117,0002,121,728
2Nov 30, 2026 21:545,46711,632,1491,094,0001,093,0002,121,728
3Nov 30, 2026 21:545,57011,746,6861,069,0001,159,0002,121,728
4Nov 30, 2026 21:545,61211,671,7591,078,0001,167,0002,121,728
5Nov 30, 2026 21:545,64011,754,0661,084,0001,172,0002,121,728
6Nov 30, 2026 21:545,87211,924,2671,131,0001,218,0002,121,728
7Nov 30, 2026 21:5429,88221,505,96810,811,0001,142,0002,113,536
8Nov 30, 2026 21:5430,06221,650,05210,866,0001,159,0002,113,536
9Nov 30, 2026 21:5430,08221,658,80510,876,0001,157,0002,113,536