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 listNov 30, 2026 23:01Dominique GarmierDominique GarmierScore: 4,067Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 30, 2026 23:033,7928,916,9871,517,00002,162,688
2Nov 30, 2026 23:033,9609,175,2901,584,00002,162,688
3Nov 30, 2026 23:033,9679,021,9511,587,00002,162,688
4Nov 30, 2026 23:033,9979,093,0851,599,00002,162,688
5Nov 30, 2026 23:034,0679,052,7121,627,00002,162,688
6Nov 30, 2026 23:034,5709,230,78901,828,0002,162,688
7Nov 30, 2026 23:034,9229,376,06701,969,0002,162,688
8Nov 30, 2026 23:0328,32719,080,85610,224,0001,107,0002,158,592
9Nov 30, 2026 23:0328,69520,794,57810,177,0001,301,0002,162,688