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 2, 2026 08:42Dominique GarmierDominique GarmierScore: 2,955Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 2, 2026 08:432,5308,804,4651,012,00002,117,632
2Dec 2, 2026 08:432,6208,804,8681,048,00002,117,632
3Dec 2, 2026 08:432,6428,804,7681,057,00002,117,632
4Dec 2, 2026 08:432,6578,794,5581,063,00002,117,632
5Dec 2, 2026 08:432,9559,165,3511,182,00002,117,632
6Dec 2, 2026 08:433,1128,997,7321,245,00002,117,632
7Dec 2, 2026 08:433,2109,437,3581,284,00002,117,632
8Dec 2, 2026 08:433,2409,059,9381,296,00002,117,632
9Dec 2, 2026 08:433,2579,068,2701,303,00002,117,632