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 21, 2026 18:19A_ShamanA_ShamanScore: 1,187,450Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 21, 2026 18:201,187,075484,122,484462,122,00012,708,0002,113,536
2Jun 21, 2026 18:201,187,092484,126,076463,095,00011,742,0002,113,536
3Jun 21, 2026 18:201,187,185484,146,395463,173,00011,701,0002,113,536
4Jun 21, 2026 18:201,187,387484,346,838462,280,00012,675,0002,113,536
5Jun 21, 2026 18:201,187,450484,225,700463,299,00011,681,0002,113,536
6Jun 21, 2026 18:201,187,530484,210,769463,366,00011,646,0002,113,536
7Jun 21, 2026 18:201,187,920484,450,618462,355,00012,813,0002,113,536
8Jun 21, 2026 18:201,187,980484,427,678463,415,00011,777,0002,113,536
9Jun 21, 2026 18:201,188,180485,081,311462,580,00012,692,0002,113,536