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 listJun 3, 2025 12:55Mikhail ShirokovMikhail ShirokovScore: 616,110Success
Source Code

Source code access is restricted. Log in to request access.

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 3, 2025 12:55616,055274,238,858245,421,0001,001,0002,490,368
2Jun 3, 2025 12:55616,065270,165,306246,426,00002,273,280
3Jun 3, 2025 12:55616,080269,459,005245,431,0001,001,0002,273,280
4Jun 3, 2025 12:55616,085269,558,465245,433,0001,001,0002,273,280
5Jun 3, 2025 12:55616,110267,303,550246,444,00002,273,280
6Jun 3, 2025 12:55616,348272,741,489245,537,0001,002,0002,490,368
7Jun 3, 2025 12:55616,410274,210,662246,564,00002,273,280
8Jun 3, 2025 12:55616,453275,190,049244,585,0001,996,0002,273,280
9Jun 3, 2025 12:55616,665272,923,139245,668,000998,0002,273,280