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 listJun 4, 2025 22:32vahookvahookError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Jul 5, 2026 22:33Victor Mercklé10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 5, 2026 22:3308,533,4221,008,00002,113,536expected "51", got "50 "
2Jul 5, 2026 22:3308,513,1241,008,00002,113,536expected "51", got "50 "
3Jul 5, 2026 22:3308,561,0741,011,00002,113,536expected "51", got "50 "
4Jun 4, 2025 22:312,83327,194,24801,133,0002,490,368
5Jun 4, 2025 22:332,85020,555,25001,140,0002,478,080
6Jun 4, 2025 22:332,86818,882,65601,147,0002,486,272
7Jun 4, 2025 22:322,96517,881,61001,186,0002,494,464
8Jun 4, 2025 22:332,98316,907,63301,193,0002,486,272
9Jun 4, 2025 22:333,08518,190,7091,234,00002,490,368
10Jun 4, 2025 22:333,15018,587,69201,260,0002,490,368
11Jun 4, 2025 22:313,22017,358,9781,288,00002,486,272
12Jun 4, 2025 22:323,24320,648,3021,297,00002,482,176
13Jun 4, 2025 22:323,26525,901,1181,306,00002,469,888
14Jun 4, 2025 22:333,32319,724,5891,329,00002,478,080
15Jun 4, 2025 22:313,34818,353,8321,339,00002,486,272
16Jun 4, 2025 22:333,37321,828,0561,349,00002,486,272
17Jun 4, 2025 22:333,46518,335,7621,386,00002,494,464
18Jun 4, 2025 22:333,49519,462,8941,398,00002,490,368