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 listDec 2, 2026 13:06Dominique GarmierDominique GarmierScore: 2,732Success
Source Code

Source code access is restricted. Log in to request access.

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 2, 2026 13:072,4308,678,946972,00002,117,632
2Dec 2, 2026 13:072,6428,747,9351,057,00002,117,632
3Dec 2, 2026 13:072,6908,825,5081,076,00002,117,632
4Dec 2, 2026 13:072,7158,789,5601,086,00002,117,632
5Dec 2, 2026 13:072,7329,234,2811,093,00002,117,632
6Dec 2, 2026 13:072,9778,914,8301,191,00002,117,632
7Dec 2, 2026 13:073,1578,993,0231,263,00002,117,632
8Dec 2, 2026 13:073,2029,027,9341,281,00002,117,632
9Dec 2, 2026 13:073,2359,408,3961,294,00002,117,632