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 listMay 16, 2026 18:59M-RochatM-RochatError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Oct 5, 2026 20:31Andrew Epstein10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 5, 2026 20:3606,463,844,7156,337,948,000115,137,0002,113,536expected "2", got "32 "
2Oct 5, 2026 20:36083,629,13656,131,00015,109,0002,117,632expected "5", got "32 "
3Oct 5, 2026 20:3607,001,536,4596,876,665,000114,122,0002,113,536expected "24", got "32 "
4May 16, 2026 19:0015,70515,352,8675,028,0001,254,0002,121,728
5May 16, 2026 19:0015,81017,030,6735,061,0001,263,0002,121,728
6May 16, 2026 19:0015,82516,560,7384,217,0002,113,0002,121,728
7May 16, 2026 19:0015,88517,153,2164,233,0002,121,0002,121,728
8May 16, 2026 19:0015,95016,923,3705,107,0001,273,0002,121,728
9May 16, 2026 19:0015,97218,058,1724,262,0002,127,0002,121,728
10May 16, 2026 19:0016,09518,155,5055,154,0001,284,0002,121,728
11May 16, 2026 19:0016,18218,571,8354,290,0002,183,0002,121,728
12May 16, 2026 19:0016,34016,199,7784,330,0002,206,0002,121,728