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 listDec 1, 2026 10:31Dominique GarmierDominique GarmierScore: 3,702Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 1, 2026 10:333,5328,922,2891,413,00002,170,880
2Dec 1, 2026 10:333,5629,047,8941,425,00002,170,880
3Dec 1, 2026 10:333,6729,158,1071,469,00002,170,880
4Dec 1, 2026 10:333,6758,992,4981,470,00002,170,880
5Dec 1, 2026 10:333,7028,966,8191,481,00002,170,880
6Dec 1, 2026 10:333,9529,187,4901,581,00002,170,880
7Dec 1, 2026 10:334,0359,258,0741,614,00002,170,880
8Dec 1, 2026 10:334,0979,093,5651,639,00002,170,880
9Dec 1, 2026 10:334,3309,276,7971,732,00002,170,880