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 9, 2026 17:58Aleksei ShahoikaAleksei ShahoikaScore: 32,822Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 9, 2026 17:5923,98725,967,8788,505,0001,090,0002,355,200
2May 9, 2026 17:5925,10726,000,0808,988,0001,055,0002,367,488
3May 9, 2026 17:5930,52228,719,07711,066,0001,143,0002,367,488
4May 9, 2026 17:5932,70227,979,73912,034,0001,047,0002,359,296
5May 9, 2026 17:5932,82228,608,54812,059,0001,070,0002,367,488
6May 9, 2026 17:5933,35731,503,93212,295,0001,048,0002,363,392
7May 9, 2026 17:5933,36528,799,21112,302,0001,044,0002,359,296
8May 9, 2026 17:5933,80530,792,12912,405,0001,117,0002,363,392
9May 9, 2026 17:5934,39528,943,99712,614,0001,144,0002,519,040