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 15, 2026 19:12Victor MerckléVictor MerckléError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
May 17, 2026 13:43M-Rochat10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 17, 2026 14:01010,107,4171,198,00002,113,536expected "392", got "255 "
2May 17, 2026 14:0109,285,8631,182,00002,113,536expected "392", got "255 "
3May 17, 2026 14:0108,953,8761,186,00002,113,536expected "392", got "255 "
4May 15, 2026 19:131,8258,404,311730,00002,113,536
5May 15, 2026 19:131,9279,511,822771,00002,113,536
6May 15, 2026 19:132,0209,619,216808,00002,113,536
7May 15, 2026 19:132,1429,708,030857,00002,113,536
8May 15, 2026 19:132,1527,915,072861,00002,113,536
9May 15, 2026 19:132,2828,014,913913,00002,113,536
10May 15, 2026 19:132,3079,334,903923,00002,113,536
11May 15, 2026 19:132,3428,455,786937,00002,113,536
12May 15, 2026 19:132,6378,344,8011,055,00002,113,536