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 14:44Victor MerckléVictor MerckléError
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 14:50018,586,68602,544,0002,375,680expected "54", got "50 "
2May 5, 2026 14:504,60720,185,8101,843,00002,375,680
3May 5, 2026 14:505,86020,291,51202,344,0002,375,680
4May 5, 2026 14:506,03217,093,89002,413,0002,367,488
5May 5, 2026 14:506,04718,730,53002,419,0002,371,584
6May 5, 2026 14:506,13018,829,68202,452,0002,371,584
7May 5, 2026 14:506,42719,365,99602,571,0002,367,488
8May 5, 2026 14:506,49719,048,44302,599,0002,367,488
9May 5, 2026 14:506,72720,984,69002,691,0002,379,776