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:15A_ShamanA_ShamanScore: 972,422Success
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:17970,012397,588,250341,287,00046,718,0002,117,632
2Jun 21, 2026 18:17970,937397,708,547341,226,00047,149,0002,117,632
3Jun 21, 2026 18:17971,500397,827,606341,411,00047,189,0002,117,632
4Jun 21, 2026 18:17972,270398,560,757341,217,00047,691,0002,117,632
5Jun 21, 2026 18:17972,422398,305,411341,326,00047,643,0002,117,632
6Jun 21, 2026 18:17972,970399,717,268341,255,00047,933,0002,117,632
7Jun 21, 2026 18:17973,617399,153,346341,134,00048,313,0002,113,536
8Jun 21, 2026 18:17973,635398,744,231341,178,00048,276,0002,113,536
9Jun 21, 2026 18:17973,785399,108,980341,167,00048,347,0002,117,632