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:34M-RochatM-RochatScore: 279,647Success
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:35279,100120,543,10998,408,00013,232,0002,113,536
2May 16, 2026 13:35279,320120,711,03198,562,00013,166,0002,113,536
3May 16, 2026 13:35279,337120,759,38998,530,00013,205,0002,113,536
4May 16, 2026 13:35279,520120,875,81898,745,00013,063,0002,113,536
5May 16, 2026 13:35279,647123,755,47798,782,00013,077,0002,113,536
6May 16, 2026 13:35279,705120,816,39598,770,00013,112,0002,113,536
7May 16, 2026 13:35279,795120,886,37398,753,00013,165,0002,113,536
8May 16, 2026 13:35279,852123,077,77998,800,00013,141,0002,113,536
9May 16, 2026 13:35280,182123,749,93098,879,00013,194,0002,113,536