将题目中的二分写法做一个小小的改变即可,注意:一定要将左边移动,不然会损失一些次数。 #include <bits/stdc++.h> using namespace std; int f(int l, int r, int cnt) { int n = 0, mid; while (l<=r) { &nbs...