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 listMar 23, 2026 06:55Dominique GarmierDominique GarmierScore: 59,018Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 23, 2026 06:5329,06329,919,67310,569,0001,056,0002,293,760
2Mar 23, 2026 06:5334,34530,645,46412,682,0001,056,0002,519,040
3Mar 23, 2026 06:5537,24843,183,87412,913,0001,986,0002,519,040
4Mar 23, 2026 06:5544,75545,568,10915,913,0001,989,0002,514,944
5Mar 23, 2026 06:5345,98040,370,22617,371,0001,021,0002,293,760
6Mar 23, 2026 06:5547,24549,301,63217,904,000994,0002,293,760
7Mar 23, 2026 06:5358,74043,588,58922,475,0001,021,0002,510,848
8Mar 23, 2026 06:5359,01852,731,55522,581,0001,026,0002,519,040
9Mar 23, 2026 06:5559,74050,023,84222,901,000995,0002,293,760
10Mar 23, 2026 06:5359,74354,325,48123,897,00002,510,848
11Mar 23, 2026 06:5359,88354,573,02022,955,000998,0002,293,760
12Mar 23, 2026 06:5361,64349,658,25623,630,0001,027,0002,523,136
13Mar 23, 2026 06:5561,83555,757,05923,704,0001,030,0002,293,760
14Mar 23, 2026 06:5363,45352,159,30425,381,00002,293,760
15Mar 23, 2026 06:5565,62554,467,99224,231,0002,019,0002,293,760