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 listJul 2, 2026 12:12A_ShamanA_ShamanScore: 351,485Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 2, 2026 12:13351,387149,951,351139,536,0001,019,0002,113,536
2Jul 2, 2026 12:13351,397149,868,284139,533,0001,026,0002,113,536
3Jul 2, 2026 12:13351,425149,893,274139,555,0001,015,0002,113,536
4Jul 2, 2026 12:13351,435151,241,924139,557,0001,017,0002,113,536
5Jul 2, 2026 12:13351,485149,954,818139,570,0001,024,0002,113,536
6Jul 2, 2026 12:13351,627149,991,094139,580,0001,071,0002,113,536
7Jul 2, 2026 12:13351,675150,033,325139,605,0001,065,0002,113,536
8Jul 2, 2026 12:13351,675150,013,996139,669,0001,001,0002,113,536
9Jul 2, 2026 12:13352,055150,206,335139,742,0001,080,0002,113,536