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:44e1011e1011Score: 1,014,205Success
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:451,012,092414,150,390398,585,0006,252,0002,113,536
2Nov 25, 2026 22:451,012,640414,358,120398,698,0006,358,0002,113,536
3Nov 25, 2026 22:451,013,190414,630,267398,939,0006,337,0002,113,536
4Nov 25, 2026 22:451,013,357414,647,969398,960,0006,383,0002,113,536
5Nov 25, 2026 22:451,014,205415,021,314399,324,0006,358,0002,113,536
6Nov 25, 2026 22:451,033,665422,774,176407,229,0006,237,0002,113,536
7Nov 25, 2026 22:451,034,265422,967,934407,428,0006,278,0002,113,536
8Nov 25, 2026 22:451,034,507423,015,624407,466,0006,337,0002,113,536
9Nov 25, 2026 22:451,034,797423,209,374407,678,0006,241,0002,113,536