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 05:59limanjun99limanjun99Score: 861,280Success
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:00860,735358,729,167343,294,0001,000,0002,494,464
2Apr 24, 2026 06:00861,060361,289,533342,428,0001,996,0002,498,560
3Apr 24, 2026 06:00861,075358,338,183343,429,0001,001,0002,490,368
4Apr 24, 2026 06:00861,265361,798,684343,505,0001,001,0002,490,368
5Apr 24, 2026 06:00861,280365,925,425342,515,0001,997,0002,502,656
6Apr 24, 2026 06:00861,315361,936,264343,525,0001,001,0002,342,912
7Apr 24, 2026 06:00861,470364,389,931341,592,0002,996,0002,494,464
8Apr 24, 2026 06:00861,502364,322,705342,604,0001,997,0002,322,432
9Apr 24, 2026 06:00861,580359,939,818342,635,0001,997,0002,494,464