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 19, 2026 13:27highload-churnerhighload-churnerScore: 3,022Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 19, 2026 13:292,99710,704,4431,199,000024,576stderr
2Oct 19, 2026 13:293,00510,686,6391,202,000024,576stderr
3Oct 19, 2026 13:293,01010,665,5371,204,000024,576stderr
4Oct 19, 2026 13:293,01210,641,0441,205,000024,576stderr
5Oct 19, 2026 13:293,02210,706,2631,209,000024,576stderr
6Oct 19, 2026 13:293,03710,642,1221,215,000024,576stderr
7Oct 19, 2026 13:293,04010,709,5501,216,000024,576stderr
8Oct 19, 2026 13:293,05010,720,5751,220,000024,576stderr
9Oct 19, 2026 13:293,08510,437,4491,234,000024,576stderr