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 listDec 28, 2025 03:44Josu San MartinJosu San MartinScore: 963,815Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 28, 2025 03:44963,103406,415,611384,241,0001,000,0002,289,664
2Dec 28, 2025 03:44963,318406,194,529385,327,00002,289,664
3Dec 28, 2025 03:44963,728415,381,523385,491,00002,289,664
4Dec 28, 2025 03:44963,770411,145,676384,507,0001,001,0002,289,664
5Dec 28, 2025 03:44963,815414,821,778385,526,00002,289,664
6Dec 28, 2025 03:44964,013414,420,187384,607,000998,0002,318,336
7Dec 28, 2025 03:44964,325412,908,404383,732,0001,998,0002,412,544
8Dec 28, 2025 03:44964,368414,917,516383,749,0001,998,0002,289,664
9Dec 28, 2025 03:44965,565411,155,400386,226,00002,289,664