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 26, 2026 20:33A_ShamanA_ShamanScore: 1,061,670Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 26, 2026 20:371,061,475433,628,576423,517,0001,073,0002,113,536
2Jun 26, 2026 20:371,061,547433,778,401423,608,0001,011,0002,113,536
3Jun 26, 2026 20:371,061,585433,742,461423,587,0001,047,0002,113,536
4Jun 26, 2026 20:371,061,670434,245,628423,660,0001,008,0002,113,536
5Jun 26, 2026 20:371,061,670433,777,221423,650,0001,018,0002,113,536
6Jun 26, 2026 20:371,061,695433,791,806423,611,0001,067,0002,113,536
7Jun 26, 2026 20:371,062,010433,849,257423,764,0001,040,0002,113,536
8Jun 26, 2026 20:371,062,152433,915,979423,838,0001,023,0002,113,536
9Jun 26, 2026 20:371,062,417434,145,942423,892,0001,075,0002,113,536