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:30Yehor BondarYehor BondarScore: 25,280Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 13, 2026 12:3124,88520,019,3348,748,0001,206,0002,113,536
2Aug 13, 2026 12:3124,96520,064,7768,876,0001,110,0002,113,536
3Aug 13, 2026 12:3125,07020,038,9158,891,0001,137,0002,117,632
4Aug 13, 2026 12:3125,17220,048,4078,836,0001,233,0002,113,536
5Aug 13, 2026 12:3125,28020,216,3098,959,0001,153,0002,113,536
6Aug 13, 2026 12:3125,33520,136,6058,983,0001,151,0002,113,536
7Aug 13, 2026 12:3125,36220,183,4668,925,0001,220,0002,113,536
8Aug 13, 2026 12:3125,41721,349,6979,001,0001,166,0002,121,728
9Aug 13, 2026 12:3125,41720,243,0828,933,0001,234,0002,113,536