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 11:37Yehor BondarYehor BondarScore: 843,877Success
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 11:38843,642347,461,175336,357,0001,100,0002,113,536
2Aug 13, 2026 11:38843,807347,571,912336,357,0001,166,0002,113,536
3Aug 13, 2026 11:38843,852347,558,574336,442,0001,099,0002,113,536
4Aug 13, 2026 11:38843,852347,553,098336,372,0001,169,0002,113,536
5Aug 13, 2026 11:38843,877347,755,259336,388,0001,163,0002,113,536
6Aug 13, 2026 11:38843,945347,660,264336,374,0001,204,0002,113,536
7Aug 13, 2026 11:38843,987347,645,802336,366,0001,229,0002,113,536
8Aug 13, 2026 11:38843,990348,770,312336,412,0001,184,0002,113,536
9Aug 13, 2026 11:38844,167348,346,613336,397,0001,270,0002,113,536