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 19:43Dominique GarmierDominique GarmierScore: 7,917Success
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 19:445,39711,930,90402,159,0002,121,728
2Nov 30, 2026 19:446,48011,946,6341,250,0001,342,0002,121,728
3Nov 30, 2026 19:446,55212,398,3821,273,0001,348,0002,121,728
4Nov 30, 2026 19:447,21512,236,2111,391,0001,495,0002,121,728
5Nov 30, 2026 19:447,91713,033,2981,495,0001,672,0002,121,728
6Nov 30, 2026 19:447,93012,730,4521,569,0001,603,0002,121,728
7Nov 30, 2026 19:4410,79213,797,8043,029,0001,288,0002,121,728
8Nov 30, 2026 19:4429,95222,012,51110,745,0001,236,0002,113,536
9Nov 30, 2026 19:4430,37722,232,46411,077,0001,074,0002,113,536