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 06:24Josu San MartinJosu San MartinError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Jul 5, 2026 23:02Victor Mercklé10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 5, 2026 23:0208,830,4291,143,00002,117,632expected "51", got "50 "
2Jul 5, 2026 23:022,8708,788,1021,148,00002,117,632
3Jul 5, 2026 23:022,8929,228,5211,157,00002,117,632
4Jan 4, 2026 06:223,78319,702,30001,513,0002,449,408
5Jan 4, 2026 06:233,81817,460,9861,527,00002,449,408
6Jan 4, 2026 06:223,82022,260,2101,528,00002,449,408
7Jan 4, 2026 06:243,90019,383,37601,560,0002,453,504
8Jan 4, 2026 06:233,91317,347,60401,565,0002,453,504
9Jan 4, 2026 06:223,97817,389,15701,591,0002,449,408
10Jan 4, 2026 06:234,00317,196,42701,601,0002,449,408
11Jan 4, 2026 06:244,03022,401,8121,612,00002,441,216
12Jan 4, 2026 06:244,29517,481,6631,718,00002,445,312