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 17:55Dominique GarmierDominique GarmierScore: 3,317Success
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 17:562,9808,921,9451,192,00002,117,632
2Dec 1, 2026 17:562,9929,042,8571,197,00002,117,632
3Dec 1, 2026 17:563,1959,092,9781,278,00002,117,632
4Dec 1, 2026 17:563,2909,054,5211,316,00002,117,632
5Dec 1, 2026 17:563,3179,174,1021,327,00002,117,632
6Dec 1, 2026 17:563,3179,088,1431,327,00002,117,632
7Dec 1, 2026 17:563,3459,216,8561,338,00002,117,632
8Dec 1, 2026 17:563,4579,173,2861,383,00002,117,632
9Dec 1, 2026 17:563,4929,558,7731,397,00002,117,632