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:31A_ShamanA_ShamanScore: 993,005Success
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:32988,700405,109,296348,604,00046,876,0002,113,536
2Jun 21, 2026 18:32991,157405,764,326348,658,00047,805,0002,113,536
3Jun 21, 2026 18:32991,650405,855,005349,769,00046,891,0002,113,536
4Jun 21, 2026 18:32991,880406,046,440349,840,00046,912,0002,113,536
5Jun 21, 2026 18:32993,005406,812,617348,951,00048,251,0002,113,536
6Jun 21, 2026 18:32993,132406,505,115350,245,00047,008,0002,113,536
7Jun 21, 2026 18:32993,380406,723,409350,174,00047,178,0002,113,536
8Jun 21, 2026 18:321,000,647409,680,762352,003,00048,256,0002,113,536
9Jun 21, 2026 18:321,000,717409,593,721351,570,00048,717,0002,113,536