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 11, 2026 08:54Victor MerckléVictor MerckléScore: 4,935Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 11, 2026 08:563,76010,727,3291,504,00002,158,592
2Jun 11, 2026 08:564,16011,045,15901,664,0002,195,456
3Jun 11, 2026 08:564,45011,163,40601,780,0002,166,784
4Jun 11, 2026 08:564,82510,997,27101,930,0002,195,456
5Jun 11, 2026 08:564,93511,095,21201,974,0002,195,456
6Jun 11, 2026 08:565,45711,743,25502,183,0002,195,456
7Jun 11, 2026 08:565,91211,515,48102,365,0002,158,592
8Jun 11, 2026 08:566,56512,064,7431,317,0001,309,0002,195,456
9Jun 11, 2026 08:566,72711,932,2501,463,0001,228,0002,195,456