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:31Josu San MartinJosu San MartinScore: 4,408Success
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:314,23316,479,09701,693,0002,437,120
2Jan 4, 2026 04:444,23518,563,1001,694,00002,445,312
3Jan 4, 2026 04:314,28520,474,42501,714,0002,441,216
4Jan 4, 2026 04:444,30519,617,00001,722,0002,449,408
5Jan 4, 2026 04:444,32021,827,02001,728,0002,445,312
6Jan 4, 2026 04:354,32320,498,24301,729,0002,445,312
7Jan 4, 2026 04:444,33818,932,22601,735,0002,445,312
8Jan 4, 2026 04:354,35315,001,93401,741,0002,445,312
9Jan 4, 2026 04:444,35817,588,19401,743,0002,445,312
10Jan 4, 2026 04:444,37019,127,61801,748,0002,449,408
11Jan 4, 2026 04:354,37516,458,05701,750,0002,535,424
12Jan 4, 2026 04:354,37819,840,28201,751,0002,441,216
13Jan 4, 2026 04:314,40014,585,03501,760,0002,441,216
14Jan 4, 2026 04:354,40819,862,23101,763,0002,445,312
15Jan 4, 2026 04:444,40818,672,22701,763,0002,441,216
16Jan 4, 2026 04:314,42815,524,89501,771,0002,445,312
17Jan 4, 2026 04:354,43516,041,36701,774,0002,277,376
18Jan 4, 2026 04:314,46319,611,2021,785,00002,437,120
19Jan 4, 2026 04:314,77320,642,3301,909,00002,441,216
20Jan 4, 2026 04:354,78322,327,26601,913,0002,441,216
21Jan 4, 2026 04:314,79019,587,565958,000958,0002,445,312
22Jan 4, 2026 04:314,79521,393,66101,918,0002,449,408
23Jan 4, 2026 04:444,79520,331,68901,918,0002,445,312
24Jan 4, 2026 04:354,80517,524,211961,000961,0002,523,136
25Jan 4, 2026 04:444,81517,323,062963,000963,0002,453,504
26Jan 4, 2026 04:354,88814,889,1601,955,00002,506,752
27Jan 4, 2026 04:315,11525,487,72702,046,0002,441,216