Largest Square Submatrix of all 1's C#_user

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 MartinError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 5, 2026 06:03Tomislav Tunkovic36.57CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 5, 2026 06:2509,441,8931,232,00002,117,632expected "2", got "50 "
2Sep 5, 2026 06:2509,578,4131,243,00002,117,632expected "2", got "50 "
3Sep 5, 2026 06:2509,327,3221,342,00002,117,632expected "2", got "50 "
4Jan 4, 2026 04:314,23316,479,09701,693,0002,437,120
5Jan 4, 2026 04:444,23518,563,1001,694,00002,445,312
6Jan 4, 2026 04:314,28520,474,42501,714,0002,441,216
7Jan 4, 2026 04:444,30519,617,00001,722,0002,449,408
8Jan 4, 2026 04:444,32021,827,02001,728,0002,445,312
9Jan 4, 2026 04:354,32320,498,24301,729,0002,445,312
10Jan 4, 2026 04:444,33818,932,22601,735,0002,445,312
11Jan 4, 2026 04:354,35315,001,93401,741,0002,445,312
12Jan 4, 2026 04:444,35817,588,19401,743,0002,445,312
13Jan 4, 2026 04:444,37019,127,61801,748,0002,449,408
14Jan 4, 2026 04:354,37516,458,05701,750,0002,535,424
15Jan 4, 2026 04:354,37819,840,28201,751,0002,441,216
16Jan 4, 2026 04:314,40014,585,03501,760,0002,441,216
17Jan 4, 2026 04:354,40819,862,23101,763,0002,445,312
18Jan 4, 2026 04:444,40818,672,22701,763,0002,441,216
19Jan 4, 2026 04:314,42815,524,89501,771,0002,445,312
20Jan 4, 2026 04:354,43516,041,36701,774,0002,277,376
21Jan 4, 2026 04:314,46319,611,2021,785,00002,437,120
22Jan 4, 2026 04:314,77320,642,3301,909,00002,441,216
23Jan 4, 2026 04:354,78322,327,26601,913,0002,441,216
24Jan 4, 2026 04:314,79019,587,565958,000958,0002,445,312
25Jan 4, 2026 04:444,79520,331,68901,918,0002,445,312
26Jan 4, 2026 04:314,79521,393,66101,918,0002,449,408
27Jan 4, 2026 04:354,80517,524,211961,000961,0002,523,136
28Jan 4, 2026 04:444,81517,323,062963,000963,0002,453,504
29Jan 4, 2026 04:354,88814,889,1601,955,00002,506,752
30Jan 4, 2026 04:315,11525,487,72702,046,0002,441,216