标签:lse else style bsp code div sort ons 调用
二分的边界判断应该是
1 for (int mid = (l+r)>>1; l <= r; mid = (l+r)>>1) 2 if (check(mid)) ans = mid, l = mid+1; 3 else r = mid-1;
而不是
1 for (int mid = (l+r)>>1; l < r; mid = (l+r)>>1) 2 if (check(mid)) ans = mid, l = mid+1; 3 else r = mid;
用sort时候写了cmp结果没调用
标签:lse else style bsp code div sort ons 调用
原文地址:https://www.cnblogs.com/antiquality/p/9289235.html