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 listJan 5, 2026 06:02Josu San MartinJosu San MartinScore: 4,610Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 5, 2026 06:023,83314,320,6211,533,00002,441,216
2Jan 5, 2026 06:023,89017,973,6401,556,00002,269,184
3Jan 5, 2026 06:023,95318,810,73101,581,0002,269,184
4Jan 5, 2026 06:024,06825,553,1531,627,00002,535,424
5Jan 5, 2026 06:024,61017,975,80801,844,0002,441,216
6Jan 5, 2026 06:025,01319,561,34102,005,0002,445,312
7Jan 5, 2026 06:025,12018,762,04402,048,0002,441,216
8Jan 5, 2026 06:025,26020,670,10802,104,0002,449,408
9Jan 5, 2026 06:026,33322,746,45702,533,0002,441,216