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 17:03Josu San MartinJosu San MartinScore: 5,375Success
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 17:035,01019,052,5161,002,0001,002,0002,441,216
2Jan 1, 2026 17:035,09518,956,11802,038,0002,449,408
3Jan 1, 2026 17:035,22017,014,2791,044,0001,044,0002,449,408
4Jan 1, 2026 16:475,23016,781,0861,046,0001,046,0002,445,312
5Jan 1, 2026 16:475,24517,568,2421,049,0001,049,0002,437,120
6Jan 1, 2026 16:475,30519,327,1191,061,0001,061,0002,441,216
7Jan 1, 2026 16:475,31017,071,9191,062,0001,062,0002,441,216
8Jan 1, 2026 16:475,32520,368,7851,065,0001,065,0002,449,408
9Jan 1, 2026 17:035,33017,678,9411,066,0001,066,0002,281,472
10Jan 1, 2026 16:475,37515,310,1681,075,0001,075,0002,453,504
11Jan 1, 2026 16:475,38023,343,0281,076,0001,076,0002,441,216
12Jan 1, 2026 16:475,38017,931,49002,152,0002,445,312
13Jan 1, 2026 17:035,38519,271,3081,077,0001,077,0002,437,120
14Jan 1, 2026 17:035,45515,640,7711,091,0001,091,0002,453,504
15Jan 1, 2026 17:035,47021,504,4931,094,0001,094,0002,449,408
16Jan 1, 2026 16:475,48018,959,5061,096,0001,096,0002,449,408
17Jan 1, 2026 17:035,52018,851,92502,208,0002,441,216
18Jan 1, 2026 17:035,52020,007,6721,104,0001,104,0002,453,504