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 listMay 16, 2026 13:31M-RochatM-RochatScore: 803,722Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 16, 2026 13:33802,727330,888,864308,037,00013,054,0002,113,536
2May 16, 2026 13:33803,010330,688,741307,974,00013,230,0002,113,536
3May 16, 2026 13:33803,560330,440,572308,375,00013,049,0002,113,536
4May 16, 2026 13:33803,585330,383,132308,395,00013,039,0002,113,536
5May 16, 2026 13:33803,722330,523,555308,290,00013,199,0002,113,536
6May 16, 2026 13:33804,352330,730,830308,509,00013,232,0002,113,536
7May 16, 2026 13:33804,462330,747,557308,638,00013,147,0002,113,536
8May 16, 2026 13:33804,760333,643,442308,713,00013,191,0002,113,536
9May 16, 2026 13:33805,210331,252,204308,979,00013,105,0002,113,536