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 18:01Josu San MartinJosu San MartinScore: 4,098Success
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Jul 5, 2026 23:29Victor Mercklé10.00CustomSolution Held
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 4, 2026 18:123,80821,955,6781,523,00002,445,312
2Jan 4, 2026 18:123,87017,462,8321,548,00002,449,408
3Jan 5, 2026 02:313,90516,299,2961,562,00002,441,216
4Jan 4, 2026 18:123,94821,038,7831,579,00002,449,408
5Jan 4, 2026 18:134,00817,702,1921,603,00002,445,312
6Jan 4, 2026 18:134,02516,551,3031,610,00002,535,424
7Jan 5, 2026 02:314,09813,029,3211,639,00002,441,216
8Jan 5, 2026 02:314,10816,992,4581,643,00002,449,408
9Jan 4, 2026 18:014,12515,665,8001,650,00002,535,424
10Jan 4, 2026 18:014,13016,982,6201,652,00002,437,120
11Jan 4, 2026 18:014,16021,999,05701,664,0002,441,216
12Jan 4, 2026 18:134,31523,876,1231,726,00002,441,216