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:40A_ShamanA_ShamanScore: 993,617Success
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:41986,735404,139,108347,187,00047,507,0002,113,536
2Jun 21, 2026 18:41987,360404,699,067348,208,00046,736,0002,113,536
3Jun 21, 2026 18:41992,537406,335,591349,768,00047,247,0002,113,536
4Jun 21, 2026 18:41993,337406,926,156348,671,00048,664,0002,113,536
5Jun 21, 2026 18:41993,617406,784,539350,184,00047,263,0002,113,536
6Jun 21, 2026 18:41994,292406,936,579350,235,00047,482,0002,113,536
7Jun 21, 2026 18:41995,452407,434,407351,171,00047,010,0002,113,536
8Jun 21, 2026 18:41996,447407,957,446350,570,00048,009,0002,113,536
9Jun 21, 2026 18:411,002,642410,357,864352,630,00048,427,0002,113,536