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 07:09Victor MerckléVictor MerckléError
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 07:13010,973,77502,266,0002,179,072expected "69", got "50 "
2Jun 11, 2026 07:13011,079,27502,321,0002,179,072expected "59", got "50 "
3Jun 11, 2026 07:135,01710,685,20402,007,0002,179,072
4Jun 11, 2026 07:135,24710,758,52602,099,0002,179,072
5Jun 11, 2026 07:135,32210,846,99502,129,0002,179,072
6Jun 11, 2026 07:135,42010,782,87102,168,0002,179,072
7Jun 11, 2026 07:135,44511,056,28002,178,0002,179,072
8Jun 11, 2026 07:135,79510,913,36302,318,0002,179,072
9Jun 11, 2026 07:135,79710,903,55102,319,0002,179,072