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 5, 2026 13:41Victor MerckléVictor MerckléScore: 5,227Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 5, 2026 13:474,89016,654,7471,956,00002,367,488
2May 5, 2026 13:474,98717,346,45701,995,0002,375,680
3May 5, 2026 13:475,04719,626,70602,019,0002,379,776
4May 5, 2026 13:475,05219,821,27302,021,0002,375,680
5May 5, 2026 13:475,22720,192,44702,091,0002,379,776
6May 5, 2026 13:476,29220,533,53402,517,0002,371,584
7May 5, 2026 13:476,51017,124,85102,604,0002,363,392
8May 5, 2026 13:476,54020,359,4441,289,0001,327,0002,379,776
9May 5, 2026 13:476,56716,991,16902,627,0002,363,392