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 listOct 3, 2025 18:07Martin StensgårdMartin StensgårdScore: 9,113,388Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 3, 2025 18:078,826,2903,557,906,2793,485,535,00044,981,0002,273,280
2Oct 3, 2025 18:079,001,5733,635,075,9533,556,658,00043,971,0002,289,664
3Oct 3, 2025 18:079,013,7603,633,774,6513,561,523,00043,981,0002,342,912
4Oct 3, 2025 18:079,037,8453,643,376,1593,576,159,00038,979,0002,277,376
5Oct 3, 2025 18:079,113,3883,671,236,0643,600,376,00044,979,0002,379,776
6Oct 3, 2025 18:079,253,1733,724,960,9383,649,294,00051,975,0002,326,528
7Oct 3, 2025 18:079,263,2003,729,823,0833,650,306,00054,974,0002,490,368
8Oct 3, 2025 18:079,329,8503,765,120,8533,686,965,00044,975,0002,351,104
9Oct 3, 2025 18:079,347,2703,768,111,4393,698,931,00039,977,0002,490,368