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 13, 2026 00:38highload-churnerhighload-churnerScore: 6,885Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 13, 2026 00:406,71513,659,1552,686,000028,672stderr
2Oct 13, 2026 00:406,79212,068,2842,717,000028,672stderr
3Oct 13, 2026 00:406,82011,563,5522,728,000028,672stderr
4Oct 13, 2026 00:406,88015,780,9622,752,000028,672stderr
5Oct 13, 2026 00:406,88511,575,3902,754,000028,672stderr
6Oct 13, 2026 00:406,90212,147,8312,761,000028,672stderr
7Oct 13, 2026 00:406,92012,142,9102,768,000028,672stderr
8Oct 13, 2026 00:406,92712,223,5182,771,000028,672stderr
9Oct 13, 2026 00:407,26212,252,4782,905,000028,672stderr