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 listOct 8, 2026 20:40janwwwjanwwwScore: 5,065Success
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Oct 16, 2026 14:08Andrew Epstein10.00CustomSolution Held
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 8, 2026 20:424,89010,656,78701,956,0002,117,632
2Oct 8, 2026 20:424,89510,576,97001,958,0002,117,632
3Oct 8, 2026 20:424,97510,537,07901,990,0002,117,632
4Oct 8, 2026 20:424,99710,716,10001,999,0002,117,632
5Oct 8, 2026 20:425,06510,814,28302,026,0002,117,632
6Oct 8, 2026 20:425,29510,855,03402,118,0002,121,728
7Oct 8, 2026 20:425,32710,849,30302,131,0002,121,728
8Oct 8, 2026 20:425,37710,911,30902,151,0002,121,728
9Oct 8, 2026 20:426,17012,954,00202,468,0002,117,632