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 1, 2026 15:59Josu San MartinJosu San MartinScore: 5,440Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 1, 2026 07:595,20516,881,56102,082,0002,449,408
2Jan 1, 2026 07:595,26517,430,5961,053,0001,053,0002,449,408
3Jan 1, 2026 07:595,35019,953,4051,070,0001,070,0002,457,600
4Jan 1, 2026 16:255,35017,728,5971,070,0001,070,0002,449,408
5Jan 1, 2026 07:595,36022,891,7441,072,0001,072,0002,445,312
6Jan 1, 2026 16:255,37519,203,7701,075,0001,075,0002,449,408
7Jan 1, 2026 07:595,40020,693,7091,080,0001,080,0002,449,408
8Jan 1, 2026 16:255,40523,195,8741,081,0001,081,0002,445,312
9Jan 1, 2026 16:255,41522,656,6211,083,0001,083,0002,453,504
10Jan 1, 2026 16:255,44018,137,5711,088,0001,088,0002,449,408
11Jan 1, 2026 15:595,44016,653,6921,088,0001,088,0002,449,408
12Jan 1, 2026 15:595,46017,496,0621,092,0001,092,0002,445,312
13Jan 1, 2026 16:255,48021,749,7771,096,0001,096,0002,445,312
14Jan 1, 2026 15:595,55017,800,6801,110,0001,110,0002,449,408
15Jan 1, 2026 07:595,55021,743,1721,110,0001,110,0002,445,312
16Jan 1, 2026 07:595,56518,236,6052,226,00002,445,312
17Jan 1, 2026 16:255,56521,799,7942,226,00002,445,312
18Jan 1, 2026 07:595,76014,182,5012,304,00002,535,424
19Jan 1, 2026 16:256,05320,282,7352,421,00002,445,312
20Jan 1, 2026 07:599,42024,182,0473,768,00002,453,504
21Jan 1, 2026 16:2511,64823,768,3194,659,00002,535,424