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:20e1011e1011Score: 907,065Success
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:21905,462371,516,295326,628,00035,557,0002,113,536
2Nov 24, 2026 22:21905,782371,961,801326,352,00035,961,0002,113,536
3Nov 24, 2026 22:21906,892372,060,504327,102,00035,655,0002,113,536
4Nov 24, 2026 22:21907,047372,112,380326,795,00036,024,0002,113,536
5Nov 24, 2026 22:21907,065372,101,995326,782,00036,044,0002,113,536
6Nov 24, 2026 22:21907,217372,642,143326,858,00036,029,0002,113,536
7Nov 24, 2026 22:21907,652372,580,454326,722,00036,339,0002,113,536
8Nov 24, 2026 22:21907,815372,358,564327,389,00035,737,0002,113,536
9Nov 24, 2026 22:21907,867372,690,947326,750,00036,397,0002,113,536