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 24, 2026 22:45e1011e1011Score: 812,722Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 24, 2026 22:46807,215332,723,697321,758,0001,128,0002,113,536
2Nov 24, 2026 22:46809,872333,256,896322,915,0001,034,0002,113,536
3Nov 24, 2026 22:46811,615333,869,542323,492,0001,154,0002,113,536
4Nov 24, 2026 22:46812,097333,998,854323,692,0001,147,0002,113,536
5Nov 24, 2026 22:46812,722334,399,878323,917,0001,172,0002,113,536
6Nov 24, 2026 22:46812,907334,468,668324,159,0001,004,0002,113,536
7Nov 24, 2026 22:46813,160334,527,500324,118,0001,146,0002,113,536
8Nov 24, 2026 22:46814,427335,469,818324,708,0001,063,0002,113,536
9Nov 24, 2026 22:46814,677335,142,638324,798,0001,073,0002,113,536