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

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

Challenge History
DateChallengerCostTypeStatus
Jul 5, 2026 23:25Victor Mercklé10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 5, 2026 23:2508,728,8951,064,00002,117,632expected "51", got "50 "
2Jul 5, 2026 23:252,8408,780,1661,136,00002,117,632
3Jul 5, 2026 23:252,85210,248,5311,141,00002,117,632
4Jan 4, 2026 05:543,88324,272,4561,553,00002,445,312
5Jan 4, 2026 05:543,88517,417,46701,554,0002,445,312
6Jan 4, 2026 05:543,93015,946,3491,572,00002,449,408
7Jan 4, 2026 06:003,95520,123,6781,582,00002,445,312
8Jan 4, 2026 06:003,97518,726,31701,590,0002,441,216
9Jan 4, 2026 05:564,01517,456,8581,606,00002,445,312
10Jan 4, 2026 05:564,03817,282,9391,615,00002,449,408
11Jan 4, 2026 06:004,05020,894,7431,620,00002,441,216
12Jan 4, 2026 05:544,05825,694,83001,623,0002,445,312
13Jan 4, 2026 05:544,07820,588,8941,631,00002,453,504
14Jan 4, 2026 05:564,08017,465,7791,632,00002,445,312
15Jan 4, 2026 05:544,13517,604,5121,654,00002,441,216
16Jan 4, 2026 05:544,13818,464,5431,655,00002,445,312
17Jan 4, 2026 05:544,16815,902,4221,667,00002,445,312
18Jan 4, 2026 05:544,34320,184,86301,737,0002,445,312