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:29limanjun99limanjun99Score: 39,495Success
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:3039,25734,096,57614,657,0001,046,0002,342,912
2Apr 24, 2026 10:3039,41732,676,33514,716,0001,051,0002,342,912
3Apr 24, 2026 10:3039,47032,302,71213,815,0001,973,0002,519,040
4Apr 24, 2026 10:3039,47736,935,39414,739,0001,052,0002,514,944
5Apr 24, 2026 10:3039,49535,089,28513,824,0001,974,0002,523,136
6Apr 24, 2026 10:3039,56735,067,21214,838,000989,0002,527,232
7Apr 24, 2026 10:3039,56735,104,34413,849,0001,978,0002,519,040
8Apr 24, 2026 10:3039,58233,684,92313,854,0001,979,0002,539,520
9Apr 24, 2026 10:3039,59032,810,88113,857,0001,979,0002,322,432