Largest Square Submatrix of all 1's NoSIMD_C#

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éScore: 6,467Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 11, 2026 13:205,67210,709,24102,269,0002,174,976
2May 11, 2026 13:206,21513,153,94902,486,0002,174,976
3May 11, 2026 13:206,35010,972,81802,540,0002,174,976
4May 11, 2026 13:206,40711,136,12102,563,0002,174,976
5May 11, 2026 13:206,46710,867,57502,587,0002,138,112
6May 11, 2026 13:206,49511,360,8581,299,0001,299,0002,174,976
7May 11, 2026 13:206,51510,994,68702,606,0002,174,976
8May 11, 2026 13:206,52711,065,0391,306,0001,305,0002,174,976
9May 11, 2026 13:206,55011,022,4311,311,0001,309,0002,174,976