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:41limanjun99limanjun99Score: 165,940Success
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:42165,39786,787,56764,155,0002,004,0002,494,464
2Apr 24, 2026 09:42165,42283,630,98864,164,0002,005,0002,486,272
3Apr 24, 2026 09:42165,59283,453,88665,234,0001,003,0002,494,464
4Apr 24, 2026 09:42165,78585,481,33365,310,0001,004,0002,342,912
5Apr 24, 2026 09:42165,94082,263,85365,371,0001,005,0002,490,368
6Apr 24, 2026 09:42166,12790,415,17265,445,0001,006,0002,502,656
7Apr 24, 2026 09:42166,17586,284,75665,463,0001,007,0002,490,368
8Apr 24, 2026 09:42166,22583,656,71965,483,0001,007,0002,490,368
9Apr 24, 2026 09:42166,43583,292,99765,566,0001,008,0002,490,368