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 06:09limanjun99limanjun99Score: 654,587Success
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 06:11654,350276,255,770259,742,0001,998,0002,494,464
2Apr 24, 2026 06:11654,435282,880,835259,776,0001,998,0002,494,464
3Apr 24, 2026 06:11654,560280,066,898259,826,0001,998,0002,490,368
4Apr 24, 2026 06:11654,570283,897,049259,830,0001,998,0002,494,464
5Apr 24, 2026 06:11654,587279,266,214259,837,0001,998,0002,502,656
6Apr 24, 2026 06:11654,602282,911,566259,843,0001,998,0002,494,464
7Apr 24, 2026 06:11654,752275,036,777260,902,000999,0002,486,272
8Apr 24, 2026 06:11654,775279,737,232260,911,000999,0002,494,464
9Apr 24, 2026 06:11654,780283,850,685259,913,0001,999,0002,490,368