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

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

Challenge History
DateChallengerCostTypeStatus
Jul 5, 2026 23:03Victor Mercklé10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 5, 2026 23:0308,774,2571,067,00002,117,632expected "51", got "50 "
2Jul 5, 2026 23:0308,713,0101,155,00002,117,632expected "51", got "50 "
3Jul 5, 2026 23:032,6108,984,6081,044,00002,117,632
4Jan 4, 2026 06:033,83517,636,1301,534,00002,445,312
5Jan 4, 2026 06:033,83821,982,6991,535,00002,449,408
6Jan 4, 2026 06:003,87815,493,93801,551,0002,445,312
7Jan 4, 2026 06:033,88319,273,99801,553,0002,445,312
8Jan 4, 2026 06:033,89317,929,2881,557,00002,449,408
9Jan 4, 2026 06:063,90022,310,5761,560,00002,437,120
10Jan 4, 2026 06:003,90517,462,2391,562,00002,453,504
11Jan 4, 2026 06:003,90816,958,3591,563,00002,445,312
12Jan 4, 2026 06:003,90822,210,9341,563,00002,449,408
13Jan 4, 2026 06:003,92017,665,5521,568,00002,453,504
14Jan 4, 2026 06:003,93814,741,5601,575,00002,535,424
15Jan 4, 2026 06:033,94016,295,6261,576,00002,445,312
16Jan 4, 2026 06:004,03016,175,3611,612,00002,445,312
17Jan 4, 2026 06:064,07317,461,27801,629,0002,449,408
18Jan 4, 2026 06:004,12516,859,6851,650,00002,441,216
19Jan 4, 2026 06:064,14517,049,61901,658,0002,449,408
20Jan 4, 2026 06:034,16818,719,0501,667,00002,449,408
21Jan 4, 2026 06:004,17020,998,2241,668,00002,449,408
22Jan 4, 2026 06:034,18020,336,1231,672,00002,445,312
23Jan 4, 2026 06:034,23322,148,6231,693,00002,441,216
24Jan 4, 2026 06:034,27317,463,41101,709,0002,445,312