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:00Josu San MartinJosu San MartinError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Jul 5, 2026 22:50Victor Mercklé10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 5, 2026 22:5108,856,3051,148,00002,117,632expected "51", got "50 "
2Jul 5, 2026 22:5108,966,8181,164,00002,117,632expected "51", got "50 "
3Jul 5, 2026 22:512,4058,670,831962,00002,117,632
4Jan 4, 2026 18:003,34518,677,4351,338,00002,453,504
5Jan 4, 2026 17:563,40322,381,8331,361,00002,449,408
6Jan 4, 2026 17:563,40818,155,0271,363,00002,441,216
7Jan 4, 2026 17:563,54523,123,5341,418,00002,449,408
8Jan 4, 2026 17:553,72318,465,8041,489,00002,449,408
9Jan 4, 2026 17:563,75317,232,9401,501,00002,277,376
10Jan 4, 2026 17:563,77318,139,2631,509,00002,441,216
11Jan 4, 2026 17:563,77516,041,80501,510,0002,449,408
12Jan 4, 2026 17:563,81313,825,5701,525,00002,441,216
13Jan 4, 2026 17:553,83018,509,2851,532,00002,437,120
14Jan 4, 2026 17:563,84319,525,2241,537,00002,453,504
15Jan 4, 2026 17:553,85318,600,5231,541,00002,437,120
16Jan 4, 2026 17:563,85819,373,4511,543,00002,445,312
17Jan 4, 2026 17:553,85818,240,95101,543,0002,437,120
18Jan 4, 2026 18:003,88320,891,1461,553,00002,445,312
19Jan 4, 2026 17:553,88522,636,32401,554,0002,449,408
20Jan 4, 2026 17:563,91819,390,9321,567,00002,445,312
21Jan 4, 2026 17:553,91819,208,80401,567,0002,441,216
22Jan 4, 2026 18:003,93318,926,3911,573,00002,445,312
23Jan 4, 2026 17:564,02517,223,507805,000805,0002,445,312
24Jan 4, 2026 17:564,33319,792,6351,733,00002,441,216