Largest Square Submatrix of all 1's NoSIMD_C#

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 listJan 4, 2026 18:09Josu San MartinJosu San MartinError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Jul 5, 2026 22:48Victor Mercklé10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 5, 2026 22:4908,804,0841,140,00002,117,632expected "51", got "50 "
2Jul 5, 2026 22:492,8728,834,4801,149,00002,117,632
3Jul 5, 2026 22:493,0008,848,1121,200,00002,117,632
4Jan 4, 2026 18:013,01315,790,3101,205,00002,453,504
5Jan 4, 2026 18:013,62017,393,3821,448,00002,445,312
6Jan 4, 2026 18:013,66518,969,0451,466,00002,437,120
7Jan 4, 2026 18:013,75318,965,4691,501,00002,445,312
8Jan 4, 2026 18:013,76816,171,0641,507,00002,441,216
9Jan 4, 2026 18:093,78317,693,1001,513,00002,441,216
10Jan 4, 2026 18:013,79517,284,1641,518,00002,445,312
11Jan 4, 2026 18:093,81517,216,1191,526,00002,445,312
12Jan 4, 2026 18:093,83316,642,2521,533,00002,449,408
13Jan 4, 2026 18:093,83821,246,0781,535,00002,441,216
14Jan 4, 2026 18:093,91317,204,47001,565,0002,445,312
15Jan 4, 2026 18:093,92816,619,8011,571,00002,535,424
16Jan 4, 2026 18:013,96520,916,3521,586,00002,445,312
17Jan 4, 2026 18:093,96815,021,4401,587,00002,449,408
18Jan 4, 2026 18:093,99816,666,4931,599,00002,437,120
19Jan 4, 2026 18:014,01014,821,3151,604,00002,531,328
20Jan 4, 2026 18:094,02519,771,5541,610,00002,449,408
21Jan 4, 2026 18:014,12021,138,45401,648,0002,445,312