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 listNov 25, 2026 23:04e1011e1011Score: 161,672Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 25, 2026 23:05160,46773,479,36457,956,0006,231,0002,117,632stderr
2Nov 25, 2026 23:05160,68073,494,46057,828,0006,444,0002,117,632stderr
3Nov 25, 2026 23:05161,20575,047,14157,954,0006,528,0002,117,632stderr
4Nov 25, 2026 23:05161,22273,792,45258,160,0006,329,0002,117,632stderr
5Nov 25, 2026 23:05161,67274,201,53658,112,0006,557,0002,117,632stderr
6Nov 25, 2026 23:05168,08576,845,59760,780,0006,454,0002,117,632stderr
7Nov 25, 2026 23:05169,73777,173,15061,353,0006,542,0002,117,632stderr
8Nov 25, 2026 23:05180,00781,199,26965,758,0006,245,0002,117,632stderr
9Nov 25, 2026 23:05185,63783,530,41867,729,0006,526,0002,117,632stderr