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 22:39e1011e1011Score: 1,014,185Success
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 22:401,011,000413,598,296398,123,0006,277,0002,113,536
2Nov 25, 2026 22:401,011,725414,395,277398,474,0006,216,0002,113,536
3Nov 25, 2026 22:401,011,790413,961,580398,410,0006,306,0002,113,536
4Nov 25, 2026 22:401,012,617414,371,588398,865,0006,182,0002,113,536
5Nov 25, 2026 22:401,014,185414,938,071399,462,0006,212,0002,113,536
6Nov 25, 2026 22:401,018,267416,622,309401,286,0006,021,0002,113,536
7Nov 25, 2026 22:401,033,907422,795,815407,458,0006,105,0002,113,536
8Nov 25, 2026 22:401,034,712423,231,948407,641,0006,244,0002,113,536
9Nov 25, 2026 22:401,035,550423,438,456407,786,0006,434,0002,113,536