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:50e1011e1011Score: 1,012,825Success
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:511,012,207414,170,309398,499,0006,384,0002,117,632stderr
2Nov 25, 2026 22:511,012,310414,665,219398,599,0006,325,0002,117,632stderr
3Nov 25, 2026 22:511,012,347414,360,745398,652,0006,287,0002,117,632stderr
4Nov 25, 2026 22:511,012,512414,530,329398,642,0006,363,0002,117,632stderr
5Nov 25, 2026 22:511,012,825414,488,631398,763,0006,367,0002,117,632stderr
6Nov 25, 2026 22:511,013,350414,684,717398,828,0006,512,0002,117,632stderr
7Nov 25, 2026 22:511,017,822416,409,772400,822,0006,307,0002,117,632stderr
8Nov 25, 2026 22:511,033,282422,663,273406,932,0006,381,0002,117,632stderr
9Nov 25, 2026 22:511,038,305424,795,750408,189,0007,133,0002,117,632stderr