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 26, 2026 20:41A_ShamanA_ShamanScore: 1,263,107Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 26, 2026 20:421,262,827514,219,652493,661,00011,470,0002,113,536
2Jun 26, 2026 20:421,262,837514,195,515493,685,00011,450,0002,113,536
3Jun 26, 2026 20:421,262,912514,237,856493,683,00011,482,0002,113,536
4Jun 26, 2026 20:421,262,945514,313,168493,790,00011,388,0002,113,536
5Jun 26, 2026 20:421,263,107514,300,731493,725,00011,518,0002,113,536
6Jun 26, 2026 20:421,263,160514,396,308493,797,00011,467,0002,113,536
7Jun 26, 2026 20:421,263,777514,580,992493,795,00011,716,0002,113,536
8Jun 26, 2026 20:421,263,885514,648,247493,795,00011,759,0002,113,536
9Jun 26, 2026 20:421,264,347514,843,560493,917,00011,822,0002,113,536