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

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

Challenge History
DateChallengerCostTypeStatus
Jul 5, 2026 22:55Victor Mercklé10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 5, 2026 22:5608,876,5071,137,00002,117,632expected "51", got "50 "
2Jul 5, 2026 22:56010,109,2651,142,00002,117,632expected "51", got "50 "
3Jul 5, 2026 22:562,6178,895,9951,047,00002,117,632
4Jan 4, 2026 06:113,70019,907,8801,480,00002,441,216
5Jan 4, 2026 06:003,70517,944,76401,482,0002,445,312
6Jan 4, 2026 06:033,70523,170,7161,482,00002,445,312
7Jan 4, 2026 06:033,72015,517,6111,488,00002,445,312
8Jan 4, 2026 06:033,73016,695,78201,492,0002,445,312
9Jan 4, 2026 18:013,76313,565,6261,505,00002,449,408
10Jan 4, 2026 06:003,76515,533,1191,506,00002,453,504
11Jan 4, 2026 06:003,80012,737,2361,520,00002,441,216
12Jan 4, 2026 06:033,83316,238,2001,533,00002,445,312
13Jan 4, 2026 06:003,84317,409,71201,537,0002,445,312
14Jan 4, 2026 18:013,85519,008,6341,542,00002,449,408
15Jan 4, 2026 06:073,86315,304,8741,545,00002,449,408
16Jan 4, 2026 18:013,87020,228,5091,548,00002,449,408
17Jan 4, 2026 06:113,87516,654,8981,550,00002,445,312
18Jan 4, 2026 06:033,89020,013,9851,556,00002,445,312
19Jan 4, 2026 06:103,89315,490,3661,557,00002,441,216
20Jan 4, 2026 06:103,89519,707,71101,558,0002,445,312
21Jan 4, 2026 06:003,90516,302,0941,562,00002,453,504
22Jan 4, 2026 06:003,90819,262,2771,563,00002,445,312
23Jan 4, 2026 06:003,91020,918,8561,564,00002,433,024
24Jan 4, 2026 06:073,94521,939,3731,578,00002,445,312
25Jan 4, 2026 06:003,98322,922,75501,593,0002,535,424
26Jan 4, 2026 06:114,01320,705,6621,605,00002,449,408
27Jan 4, 2026 06:034,03522,185,8831,614,00002,441,216
28Jan 4, 2026 06:034,04015,189,1951,616,00002,449,408
29Jan 4, 2026 06:034,05519,324,5181,622,00002,445,312
30Jan 4, 2026 06:074,07523,115,5691,630,00002,445,312
31Jan 4, 2026 06:104,10523,617,8331,642,00002,445,312
32Jan 4, 2026 06:004,15024,274,95101,660,0002,449,408
33Jan 4, 2026 06:034,17017,805,59401,668,0002,445,312