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 28, 2026 08:21Victor MerckléVictor MerckléScore: 1,154,387Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 28, 2026 08:231,153,485478,998,541459,397,0001,997,0002,490,368stderr
2Apr 28, 2026 08:231,153,832478,058,527459,536,0001,997,0002,490,368stderr
3Apr 28, 2026 08:231,153,932479,014,362459,575,0001,998,0002,494,464stderr
4Apr 28, 2026 08:231,154,230481,113,133459,694,0001,998,0002,490,368stderr
5Apr 28, 2026 08:231,154,387478,023,306460,756,000999,0002,490,368stderr
6Apr 28, 2026 08:231,154,397482,092,070459,761,0001,998,0002,338,816stderr
7Apr 28, 2026 08:231,155,480480,392,066461,192,0001,000,0002,502,656stderr
8Apr 28, 2026 08:231,155,670479,648,338461,268,0001,000,0002,338,816stderr
9Apr 28, 2026 08:231,155,700485,050,708461,280,0001,000,0002,494,464stderr