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:35Dominique GarmierDominique GarmierScore: 9,662Success
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:367,39712,737,3611,418,0001,541,0002,121,728
2Nov 30, 2026 19:368,50013,896,8272,196,0001,204,0002,121,728
3Nov 30, 2026 19:369,03713,394,9992,432,0001,183,0002,121,728
4Nov 30, 2026 19:369,25713,454,0032,466,0001,237,0002,121,728
5Nov 30, 2026 19:369,66213,339,9662,504,0001,361,0002,121,728
6Nov 30, 2026 19:3610,72513,829,1452,876,0001,414,0002,121,728
7Nov 30, 2026 19:3611,45214,322,6683,283,0001,298,0002,121,728
8Nov 30, 2026 19:36106,29252,106,81435,966,0006,551,0002,113,536
9Nov 30, 2026 19:36116,07756,439,33639,962,0006,469,0002,113,536