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 listAug 15, 2026 11:10Tomislav TunkovicTomislav TunkovicScore: 1,887Success
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 5, 2026 10:34C#_user26.16CustomSolution Held
Sep 5, 2026 09:47C#_user26.16CustomSolution Held
Sep 5, 2026 08:53C#_user26.16CustomSolution Held
Sep 5, 2026 00:30Victor Mercklé26.16CustomSolution Held
Sep 4, 2026 22:55Victor Mercklé26.16CustomSolution Held
Sep 4, 2026 14:24Victor Mercklé26.16CustomSolution Held
Sep 4, 2026 13:38Victor Mercklé26.16CustomSolution Held
Sep 4, 2026 13:15Victor Mercklé26.16CustomSolution Held
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 15, 2026 11:111,8229,384,394729,000020,480
2Aug 15, 2026 11:111,8508,561,275740,000020,480
3Aug 15, 2026 11:111,8578,603,552743,000020,480
4Aug 15, 2026 11:111,87010,383,389748,000020,480
5Aug 15, 2026 11:111,8878,705,239755,000020,480
6Aug 15, 2026 11:111,9228,840,651769,000020,480
7Aug 15, 2026 11:111,9359,511,662774,000020,480
8Aug 15, 2026 11:111,9509,371,123780,000020,480
9Aug 15, 2026 11:111,9608,681,740784,000020,480