Largest Square Submatrix of all 1's C#_user

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 listMar 12, 2026 03:48olliecrowolliecrowError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Jul 5, 2026 23:17Victor Mercklé50.95CustomSolution Broken
May 17, 2026 14:58M-Rochat50.95CustomSolution Held
May 17, 2026 14:20M-Rochat50.95CustomSolution Held
May 17, 2026 13:43M-Rochat50.95CustomSolution Held
Apr 21, 2026 11:55Keefe50.95RecheckSolution Held
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 5, 2026 23:1708,737,882931,00002,117,632expected "51", got "50"
2Jul 5, 2026 23:1708,751,989795,00002,117,632expected "51", got "50"
3Jul 5, 2026 23:172,0128,695,525805,00002,117,632
4Mar 12, 2026 03:483,64014,678,4761,456,00002,490,368
5Mar 12, 2026 03:483,72520,050,4641,490,00002,494,464
6Mar 12, 2026 03:483,79016,311,8811,516,00002,498,560
7Mar 12, 2026 03:483,82020,578,9771,528,00002,494,464
8Mar 12, 2026 03:483,95317,486,7391,581,00002,494,464
9Mar 12, 2026 03:483,97324,793,2691,589,00002,498,560
10Mar 12, 2026 03:484,01818,421,1261,607,00002,494,464
11Mar 12, 2026 03:484,04815,042,6861,619,00002,494,464
12Mar 12, 2026 03:484,07317,245,5001,629,00002,498,560