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:10e1011e1011Score: 141,087Success
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:12139,54065,468,85949,436,0006,380,0002,113,536
2Nov 25, 2026 23:12139,92565,401,96249,604,0006,366,0002,113,536
3Nov 25, 2026 23:12140,27765,627,22949,610,0006,501,0002,113,536
4Nov 25, 2026 23:12140,97265,628,60249,817,0006,572,0002,113,536
5Nov 25, 2026 23:12141,08766,109,10849,857,0006,578,0002,113,536
6Nov 25, 2026 23:12143,47766,621,81051,138,0006,253,0002,113,536
7Nov 25, 2026 23:12144,63067,515,21551,272,0006,580,0002,113,536
8Nov 25, 2026 23:12171,71578,348,32062,106,0006,580,0002,113,536
9Nov 25, 2026 23:12179,47081,459,63765,359,0006,429,0002,113,536