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:32e1011e1011Score: 1,166,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 24, 2026 22:341,162,277474,511,306409,367,00055,544,0002,113,536
2Nov 24, 2026 22:341,163,185474,568,064409,095,00056,179,0002,113,536
3Nov 24, 2026 22:341,163,445474,738,611410,332,00055,046,0002,113,536
4Nov 24, 2026 22:341,166,137475,908,362411,072,00055,383,0002,113,536
5Nov 24, 2026 22:341,166,185476,259,062409,881,00056,593,0002,113,536
6Nov 24, 2026 22:341,167,062476,367,701410,227,00056,598,0002,113,536
7Nov 24, 2026 22:341,167,727476,842,835410,228,00056,863,0002,113,536
8Nov 24, 2026 22:341,170,602479,093,241412,086,00056,155,0002,113,536
9Nov 24, 2026 22:341,170,722477,559,718411,956,00056,333,0002,113,536