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 06:01Dominique GarmierDominique GarmierScore: 3,872Success
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 06:033,4478,830,3391,379,00002,162,688
2Dec 1, 2026 06:033,64510,224,2971,458,00002,162,688
3Dec 1, 2026 06:033,7509,618,5411,500,00002,162,688
4Dec 1, 2026 06:033,8679,279,2071,547,00002,162,688
5Dec 1, 2026 06:033,8729,190,6631,549,00002,162,688
6Dec 1, 2026 06:033,8759,166,0011,550,00002,162,688
7Dec 1, 2026 06:033,9179,272,5981,567,00002,162,688
8Dec 1, 2026 06:033,9909,366,30501,596,0002,162,688
9Dec 1, 2026 06:0322,25716,568,0897,845,0001,058,0002,158,592