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 listOct 8, 2026 20:18janwwwjanwwwScore: 3,342Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 8, 2026 20:192,9829,979,2081,193,00002,117,632
2Oct 8, 2026 20:193,0559,895,0711,222,00002,117,632
3Oct 8, 2026 20:193,10510,060,4911,242,00002,117,632
4Oct 8, 2026 20:193,27710,058,7721,311,00002,117,632
5Oct 8, 2026 20:193,34210,072,0101,337,00002,117,632
6Oct 8, 2026 20:193,34710,657,2721,339,00002,117,632
7Oct 8, 2026 20:193,46010,102,7511,384,00002,117,632
8Oct 8, 2026 20:193,54210,261,8461,417,00002,117,632
9Oct 8, 2026 20:193,59710,750,0401,439,00002,117,632