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 24, 2026 10:21limanjun99limanjun99Score: 79,395Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 24, 2026 10:2279,25748,875,34230,681,0001,022,0002,510,848
2Apr 24, 2026 10:2279,27247,445,28330,687,0001,022,0002,514,944
3Apr 24, 2026 10:2279,31050,015,06630,701,0001,023,0002,519,040
4Apr 24, 2026 10:2279,34049,183,95230,713,0001,023,0002,519,040
5Apr 24, 2026 10:2279,39546,639,35130,734,0001,024,0002,523,136
6Apr 24, 2026 10:2279,39548,011,92229,774,0001,984,0002,510,848
7Apr 24, 2026 10:2279,46049,333,54529,798,0001,986,0002,510,848
8Apr 24, 2026 10:2279,61547,991,82229,856,0001,990,0002,342,912
9Apr 24, 2026 10:2279,67051,797,33829,877,0001,991,0002,514,944