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 01:42Dominique GarmierDominique GarmierScore: 3,090Success
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 01:442,9009,053,1351,160,00002,117,632
2Dec 2, 2026 01:442,9909,000,2361,196,00002,117,632
3Dec 2, 2026 01:442,9979,029,6091,199,00002,117,632
4Dec 2, 2026 01:443,0109,354,9681,204,00002,117,632
5Dec 2, 2026 01:443,0909,163,2391,236,00002,117,632
6Dec 2, 2026 01:443,1779,025,3721,271,00002,117,632
7Dec 2, 2026 01:443,2379,448,1931,295,00002,117,632
8Dec 2, 2026 01:443,3229,227,0621,329,00002,117,632
9Dec 2, 2026 01:443,3459,477,9841,338,00002,117,632