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:54M-RochatM-RochatScore: 40,885Success
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:5539,59724,993,94212,674,0003,165,0002,113,536
2May 16, 2026 13:5539,86228,179,46012,759,0003,186,0002,113,536
3May 16, 2026 13:5540,36525,316,60512,919,0003,227,0002,113,536
4May 16, 2026 13:5540,41528,333,03012,935,0003,231,0002,113,536
5May 16, 2026 13:5540,88525,261,24313,087,0003,267,0002,113,536
6May 16, 2026 13:5541,01225,361,74313,127,0003,278,0002,113,536
7May 16, 2026 13:5541,91027,759,57713,624,0003,140,0002,113,536
8May 16, 2026 13:5542,07226,040,91913,677,0003,152,0002,113,536
9May 16, 2026 13:5542,22027,209,95813,725,0003,163,0002,113,536