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

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

Challenge History
DateChallengerCostTypeStatus
Jul 5, 2026 22:52Victor Mercklé10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 5, 2026 22:5208,909,3701,137,00002,117,632expected "51", got "50 "
2Jul 5, 2026 22:5208,783,5451,127,00002,117,632expected "51", got "50 "
3Jul 5, 2026 22:5208,856,9921,134,00002,117,632expected "51", got "50 "
4Jan 4, 2026 18:072,99021,846,0431,196,00002,449,408
5Jan 4, 2026 18:043,23516,440,8941,294,00002,445,312
6Jan 4, 2026 18:073,25017,004,2641,300,00002,445,312
7Jan 4, 2026 18:073,26519,583,3511,306,00002,453,504
8Jan 4, 2026 18:073,50814,806,89901,403,0002,457,600
9Jan 4, 2026 18:043,68015,090,1821,472,00002,449,408
10Jan 4, 2026 18:073,80017,295,59101,520,0002,449,408
11Jan 4, 2026 18:043,82022,710,6321,528,00002,449,408
12Jan 4, 2026 18:073,82014,551,1091,528,00002,445,312
13Jan 4, 2026 18:073,84019,221,4791,536,00002,445,312
14Jan 4, 2026 18:073,85021,269,4301,540,00002,535,424
15Jan 4, 2026 18:043,87017,106,13101,548,0002,277,376
16Jan 4, 2026 18:073,89319,656,7631,557,00002,453,504
17Jan 4, 2026 18:073,89818,209,9831,559,00002,449,408
18Jan 4, 2026 18:073,90816,171,1711,563,00002,437,120
19Jan 4, 2026 18:073,92815,286,2861,571,00002,449,408
20Jan 4, 2026 18:073,93522,640,1551,574,00002,445,312
21Jan 4, 2026 18:043,94022,687,4061,576,00002,445,312
22Jan 4, 2026 18:043,99317,463,6971,597,00002,449,408
23Jan 4, 2026 18:074,21318,725,33701,685,0002,453,504
24Jan 4, 2026 18:074,33817,725,1521,735,00002,449,408