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 09:45limanjun99limanjun99Score: 115,060Success
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 09:47114,41760,533,80643,778,0001,989,0002,486,272
2Apr 24, 2026 09:47114,61562,536,53943,853,0001,993,0002,342,912
3Apr 24, 2026 09:47114,79563,483,68443,922,0001,996,0002,342,912
4Apr 24, 2026 09:47115,03059,438,15344,012,0002,000,0002,494,464
5Apr 24, 2026 09:47115,06058,401,89544,023,0002,001,0002,490,368
6Apr 24, 2026 09:47115,09767,771,27144,038,0002,001,0002,494,464
7Apr 24, 2026 09:47115,49766,870,54944,191,0002,008,0002,498,560
8Apr 24, 2026 09:47115,55265,515,38144,255,0001,966,0002,498,560
9Apr 24, 2026 09:47115,67565,779,01345,265,0001,005,0002,494,464