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 listMay 11, 2026 13:15Victor MerckléVictor MerckléError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 4, 2026 21:54Tomislav Tunkovic10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 4, 2026 21:55012,371,94302,513,0002,179,072expected "7", got "50 "
2Sep 4, 2026 21:55013,442,8162,377,0001,542,0002,138,112expected "1150", got "255 "
3Sep 4, 2026 21:55014,392,7883,604,0001,217,0002,138,112expected "1526", got "255 "
4May 11, 2026 13:205,67210,709,24102,269,0002,174,976
5May 11, 2026 13:206,21513,153,94902,486,0002,174,976
6May 11, 2026 13:206,35010,972,81802,540,0002,174,976
7May 11, 2026 13:206,40711,136,12102,563,0002,174,976
8May 11, 2026 13:206,46710,867,57502,587,0002,138,112
9May 11, 2026 13:206,49511,360,8581,299,0001,299,0002,174,976
10May 11, 2026 13:206,51510,994,68702,606,0002,174,976
11May 11, 2026 13:206,52711,065,0391,306,0001,305,0002,174,976
12May 11, 2026 13:206,55011,022,4311,311,0001,309,0002,174,976