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 13, 2026 12:57Yehor BondarYehor BondarScore: 24,240Success
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 7, 2026 08:24C#_user10.00CustomSolution Held
Sep 5, 2026 10:37C#_user10.00CustomSolution Held
Sep 5, 2026 09:08C#_user10.00CustomSolution Held
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 13, 2026 12:5823,82020,813,3968,458,0001,070,0002,113,536
2Aug 13, 2026 12:5823,96019,719,5258,415,0001,169,0002,117,632
3Aug 13, 2026 12:5824,11019,812,1998,467,0001,177,0002,113,536
4Aug 13, 2026 12:5824,23019,811,7658,519,0001,173,0002,117,632
5Aug 13, 2026 12:5824,24019,756,5538,527,0001,169,0002,113,536
6Aug 13, 2026 12:5824,34219,779,8268,575,0001,162,0002,113,536
7Aug 13, 2026 12:5824,64519,917,2918,789,0001,069,0002,117,632
8Aug 13, 2026 12:5824,73019,982,8138,800,0001,092,0002,117,632
9Aug 13, 2026 12:5824,73719,973,4478,828,0001,067,0002,117,632