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 listApr 28, 2026 06:37Charles CabergsCharles CabergsScore: 159,265Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 28, 2026 06:38155,89580,862,88940,231,00022,127,0002,494,464stderr
2Apr 28, 2026 06:38156,58283,892,19140,409,00022,224,0002,494,464stderr
3Apr 28, 2026 06:38157,34777,847,14739,961,00022,978,0002,490,368stderr
4Apr 28, 2026 06:38158,73278,740,60647,368,00016,125,0002,494,464stderr
5Apr 28, 2026 06:38159,26583,328,31043,798,00019,908,0002,490,368stderr
6Apr 28, 2026 06:38159,36583,581,61146,814,00016,932,0002,502,656stderr
7Apr 28, 2026 06:38161,70784,446,14143,459,00021,224,0002,490,368stderr
8Apr 28, 2026 06:38232,207107,327,51071,910,00020,973,0002,547,712stderr
9Apr 28, 2026 06:38234,145111,253,25074,524,00019,134,0002,490,368stderr