洛谷传送门
输入时处理出最小的答案和最大的答案,然后二分答案即可。
其余细节看代码
1 #include <iostream> 2 #include <cstdio> 3 4 using namespace std; 5 6 int n, m, a[100001], x, y, ans = 100001; 7 8 bool pd(int mid) 9 19 } 20 if(tot > m) return 0; 21 return 1;//如果是小于m的话也还可以再分 22 } 23 24 int main() 25 34 while(x <= y) 35 40 printf("%d", x); 41 return 0; 42 }View Code
上一篇:公路修建(Prim)
下一篇:Divide Groups(分组)(二分图染色)
二分









