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 06:29Victor 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 06:35010,857,62002,221,0002,179,072expected "56", got "50 "
2Jun 11, 2026 06:354,60510,562,15601,842,0002,179,072
3Jun 11, 2026 06:354,85710,804,50501,943,0002,179,072
4Jun 11, 2026 06:354,99210,733,93301,997,0002,179,072
5Jun 11, 2026 06:355,14510,779,80302,058,0002,179,072
6Jun 11, 2026 06:355,40711,011,55802,163,0002,179,072
7Jun 11, 2026 06:355,51210,862,07202,205,0002,179,072
8Jun 11, 2026 06:355,68710,916,12602,275,0002,179,072
9Jun 11, 2026 06:355,80711,016,92702,323,0002,179,072