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:57e1011e1011Score: 1,033,952Success
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:581,011,715414,055,872398,328,0006,358,0002,117,632stderr
2Nov 25, 2026 22:581,012,452414,207,811398,421,0006,560,0002,117,632stderr
3Nov 25, 2026 22:581,012,645414,794,917398,515,0006,543,0002,117,632stderr
4Nov 25, 2026 22:581,014,435415,344,452399,220,0006,554,0002,117,632stderr
5Nov 25, 2026 22:581,033,952423,259,654407,153,0006,428,0002,117,632stderr
6Nov 25, 2026 22:581,034,122423,011,783407,219,0006,430,0002,117,632stderr
7Nov 25, 2026 22:581,034,700423,235,266407,436,0006,444,0002,117,632stderr
8Nov 25, 2026 22:581,035,460423,520,009407,603,0006,581,0002,117,632stderr
9Nov 25, 2026 22:581,039,937425,384,699409,579,0006,396,0002,117,632stderr