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 listApr 20, 2026 12:52Dominique GarmierDominique GarmierScore: 104,142Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 20, 2026 12:53102,82568,888,75830,095,00011,035,0002,449,408
2Apr 20, 2026 12:53103,48069,585,87628,268,00013,124,0002,473,984
3Apr 20, 2026 12:53103,49562,419,74429,282,00012,116,0002,486,272
4Apr 20, 2026 12:53103,99570,265,88532,467,0009,131,0002,469,888
5Apr 20, 2026 12:53104,14284,180,94029,465,00012,192,0002,478,080
6Apr 20, 2026 12:53104,18568,528,58229,477,00012,197,0002,473,984
7Apr 20, 2026 12:53104,25772,559,43227,802,00013,901,0002,510,848
8Apr 20, 2026 12:53104,51777,472,52630,858,00010,949,0002,482,176
9Apr 20, 2026 12:53104,58071,274,20330,876,00010,956,0002,482,176