深入浅出中这道题有两篇代码(深基P178),其中第一篇代码直接tot += upper_bound(a,a+n,a[i]+c) - lower_bound(a,a+n,a[i]+c)但是这里并没有提到找不到这个数的情况,所以这里lower_bound和upper_bound遇到无解情况会返回什么?该怎样处理?
tot += upper_bound(a,a+n,a[i]+c) - lower_bound(a,a+n,a[i]+c)
lower_bound
upper_bound