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 25, 2025 10:48rogue *rogue *Score: 901,695Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 25, 2025 10:48900,193387,102,084358,077,0002,000,0002,367,488
2May 25, 2025 10:48900,443381,164,552360,177,00002,371,584
3May 25, 2025 10:48901,378388,912,589360,551,00002,486,272
4May 25, 2025 10:48901,600390,123,144360,640,00002,371,584
5May 25, 2025 10:48901,695389,040,442358,680,0001,998,0002,457,600
6May 25, 2025 10:48901,760384,134,316359,705,000999,0002,375,680
7May 25, 2025 10:48901,833386,303,506358,735,0001,998,0002,519,040
8May 25, 2025 10:48901,920389,623,490358,770,0001,998,0002,519,040
9May 25, 2025 10:48902,163391,290,404357,867,0002,998,0002,510,848