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 listSep 13, 2026 22:23Andrew EpsteinAndrew EpsteinScore: 2,515Success
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 14, 2026 10:11Haha Expert10.00CustomSolution Held
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 13, 2026 22:322,4309,318,026972,000028,672stderr
2Sep 13, 2026 22:322,4779,332,677991,000028,672stderr
3Sep 13, 2026 22:322,5029,355,9411,001,000028,672stderr
4Sep 13, 2026 22:322,5109,412,2661,004,000028,672stderr
5Sep 13, 2026 22:322,5159,124,5901,006,000028,672stderr
6Sep 13, 2026 22:322,5309,511,6241,012,000028,672stderr
7Sep 13, 2026 22:322,5629,416,0511,025,000028,672stderr
8Sep 13, 2026 22:322,5709,401,7091,028,000028,672stderr
9Sep 13, 2026 22:322,5879,293,0021,035,000028,672stderr