标签:void 条件 pre 二分 for c++ else 范围 i++
void solve() {//二分
int l = 0, r = INF;//二分范围
for (int i = 0; i < 50; i++) {
int mid = (l + r) / 2;
if (C(mid))l = mid;//满足条件函数寻找更优解,往更大的x找
else r = mid;//不满足条件函数往更小的x找
}
}
标签:void 条件 pre 二分 for c++ else 范围 i++
原文地址:https://www.cnblogs.com/JihuiPeng/p/13662789.html