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 14:38highload-churnerhighload-churnerScore: 87,630Success
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 14:4285,27743,102,78727,697,0006,414,00024,576
2Oct 9, 2026 14:4286,82243,634,63528,273,0006,456,00024,576
3Oct 9, 2026 14:4286,82243,716,79428,137,0006,592,00024,576
4Oct 9, 2026 14:4286,89243,507,85728,323,0006,434,00024,576
5Oct 9, 2026 14:4287,63044,026,57228,656,0006,396,00024,576
6Oct 9, 2026 14:4287,73744,020,75628,561,0006,534,00024,576
7Oct 9, 2026 14:4294,43246,767,68331,396,0006,377,00024,576
8Oct 9, 2026 14:4298,89048,458,00333,079,0006,477,00024,576
9Oct 9, 2026 14:4299,12748,576,30733,179,0006,472,00024,576