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:43A_ShamanA_ShamanScore: 986,160Success
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:44983,482403,007,167346,377,00047,016,0002,113,536
2Jun 21, 2026 18:44984,617403,169,289346,168,00047,679,0002,113,536
3Jun 21, 2026 18:44984,930403,578,496346,889,00047,083,0002,113,536
4Jun 21, 2026 18:44985,130403,721,381346,769,00047,283,0002,113,536
5Jun 21, 2026 18:44986,160404,107,600346,288,00048,176,0002,113,536
6Jun 21, 2026 18:44987,730404,841,248347,963,00047,129,0002,113,536
7Jun 21, 2026 18:44992,420406,241,697349,701,00047,267,0002,113,536
8Jun 21, 2026 18:44995,482408,125,358351,022,00047,171,0002,113,536
9Jun 21, 2026 18:44997,107408,097,744352,240,00046,603,0002,113,536