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 04:56Josu San MartinJosu San MartinScore: 4,358Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 4, 2026 04:523,61521,146,9871,446,00002,453,504
2Jan 4, 2026 05:414,06516,023,4191,626,00002,457,600
3Jan 4, 2026 05:414,25017,327,0881,700,00002,449,408
4Jan 4, 2026 04:444,28015,264,7171,712,00002,453,504
5Jan 4, 2026 04:444,29523,222,0731,718,00002,445,312
6Jan 4, 2026 04:444,30319,907,1321,721,00002,445,312
7Jan 4, 2026 04:444,31019,204,9921,724,00002,449,408
8Jan 4, 2026 04:524,32016,414,8651,728,00002,441,216
9Jan 4, 2026 04:564,32321,001,0371,729,00002,449,408
10Jan 4, 2026 04:444,35817,464,89001,743,0002,453,504
11Jan 4, 2026 04:444,38311,116,92501,753,0002,535,424
12Jan 4, 2026 04:444,39022,320,9041,756,00002,449,408
13Jan 4, 2026 05:414,42514,800,1801,770,00002,449,408
14Jan 4, 2026 04:444,58317,321,3051,833,00002,449,408
15Jan 4, 2026 04:564,79317,715,26101,917,0002,510,848
16Jan 4, 2026 04:524,79515,088,2111,918,00002,523,136
17Jan 4, 2026 04:444,80523,849,570961,000961,0002,445,312
18Jan 4, 2026 04:564,81019,147,211962,000962,0002,453,504