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 18, 2026 01:34Josu San MartinJosu San MartinScore: 3,798Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 18, 2026 01:353,65318,483,7081,461,00002,449,408
2Jan 18, 2026 01:363,67818,592,8981,471,00002,445,312
3Jan 18, 2026 01:343,69819,531,5401,479,00002,441,216
4Jan 18, 2026 01:273,70520,486,7181,482,00002,453,504
5Jan 18, 2026 01:363,73819,195,0171,495,00002,449,408
6Jan 18, 2026 01:273,74518,348,5871,498,00002,453,504
7Jan 18, 2026 01:333,75020,240,9121,500,00002,437,120
8Jan 18, 2026 01:333,75022,637,2851,500,00002,453,504
9Jan 18, 2026 01:333,75317,284,8541,501,00002,441,216
10Jan 18, 2026 01:273,76524,283,9631,506,00002,441,216
11Jan 18, 2026 01:343,77822,142,6991,511,00002,457,600
12Jan 18, 2026 01:353,78015,744,8711,512,00002,535,424
13Jan 18, 2026 01:333,78813,517,8401,515,00002,445,312
14Jan 18, 2026 01:333,79819,600,0561,519,00002,445,312
15Jan 18, 2026 01:343,79818,601,00601,519,0002,449,408
16Jan 18, 2026 01:353,80820,080,5241,523,00002,445,312
17Jan 18, 2026 01:273,81518,999,6871,526,00002,441,216
18Jan 18, 2026 01:353,82515,632,8741,530,00002,445,312
19Jan 18, 2026 01:273,82817,321,4521,531,00002,449,408
20Jan 18, 2026 01:353,84821,069,5231,539,00002,441,216
21Jan 18, 2026 01:343,84817,469,4931,539,00002,445,312
22Jan 18, 2026 01:273,86018,846,2221,544,00002,445,312
23Jan 18, 2026 01:343,87823,634,5821,551,00002,445,312
24Jan 18, 2026 01:363,92023,348,0271,568,00002,437,120
25Jan 18, 2026 01:354,00520,943,55801,602,0002,527,232
26Jan 18, 2026 01:334,07015,596,6561,628,00002,449,408
27Jan 18, 2026 01:344,15516,281,68401,662,0002,441,216