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 9, 2026 18:44highload-churnerhighload-churnerScore: 2,610Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 9, 2026 18:462,4329,726,190973,000024,576
2Oct 9, 2026 18:462,4529,620,955981,000024,576
3Oct 9, 2026 18:462,4959,708,727998,000024,576
4Oct 9, 2026 18:462,5559,712,5841,022,000024,576
5Oct 9, 2026 18:462,6109,997,2091,044,000024,576
6Oct 9, 2026 18:462,61511,578,5721,046,000024,576
7Oct 9, 2026 18:462,6309,772,5481,052,000024,576
8Oct 9, 2026 18:462,6859,748,2601,074,000024,576
9Oct 9, 2026 18:462,9459,900,9761,178,000024,576