s******d 发帖数: 61 | | I*******l 发帖数: 203 | 2 Are there any additional conditions? If no, then it seems you can not do
this in o(n^2) time. This is because you can construct an array such that
all the pairwise differences are distinct, so there are \theta(n^2) numbers
to output. For example, 1,2,4,8,.... |
|