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 09:37Dominique GarmierDominique GarmierScore: 3,750Success
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 09:393,5829,140,1121,433,00002,162,688
2Dec 1, 2026 09:393,6078,953,4921,443,00002,162,688
3Dec 1, 2026 09:393,6959,305,3601,478,00002,162,688
4Dec 1, 2026 09:393,7079,019,8151,483,00002,162,688
5Dec 1, 2026 09:393,7509,191,9251,500,00002,162,688
6Dec 1, 2026 09:393,8229,103,1431,529,00002,162,688
7Dec 1, 2026 09:394,0329,340,1371,613,00002,162,688
8Dec 1, 2026 09:394,15010,752,9111,660,00002,162,688
9Dec 1, 2026 09:394,23010,935,60301,692,0002,162,688