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 11:10limanjun99limanjun99Score: 21,560Success
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 11:1221,36222,996,3707,477,0001,068,0002,523,136
2Apr 24, 2026 11:1221,40530,309,9967,492,0001,070,0002,523,136
3Apr 24, 2026 11:1221,46723,851,8377,514,0001,073,0002,531,328
4Apr 24, 2026 11:1221,51528,707,7377,531,0001,075,0002,527,232
5Apr 24, 2026 11:1221,56030,896,3667,546,0001,078,0002,519,040
6Apr 24, 2026 11:1221,57024,369,4867,550,0001,078,0002,338,816
7Apr 24, 2026 11:1221,57528,517,5347,552,0001,078,0002,523,136
8Apr 24, 2026 11:1221,71226,550,3467,600,0001,085,0002,535,424
9Apr 24, 2026 11:1221,85525,923,8487,650,0001,092,0002,527,232