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 23:05e1011e1011Score: 668,765Success
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 23:06668,685276,810,420266,445,0001,029,0002,113,536
2Nov 24, 2026 23:06668,715276,787,285266,427,0001,059,0002,113,536
3Nov 24, 2026 23:06668,740277,088,087266,446,0001,050,0002,113,536
4Nov 24, 2026 23:06668,762277,233,818266,432,0001,073,0002,113,536
5Nov 24, 2026 23:06668,765277,216,037266,434,0001,072,0002,113,536
6Nov 24, 2026 23:06668,817277,258,056266,440,0001,087,0002,113,536
7Nov 24, 2026 23:06668,822276,834,986266,421,0001,108,0002,113,536
8Nov 24, 2026 23:06668,880277,203,419266,443,0001,109,0002,113,536
9Nov 24, 2026 23:06668,970277,332,582266,482,0001,106,0002,113,536