二分
YDYKL
这个作者很懒,什么都没留下…
展开
-
HDU 2199 简单的二分
#include#include#includedouble Y;double solve(double x){return 6*pow(x,7.0)+8*pow(x,6.0)+7*pow(x,3.0)+5*x*x-Y*x;}int main(){ int T; double原创 2011-07-16 16:43:31 · 791 阅读 · 0 评论 -
POJ 2456
http://poj.org/problem?id=2456 二分枚举 答案 #include #include #include using namespace std; int a[100010]; bool search(int n, int c, int d) { int i, num, index; num = 1; index = 0; for(i=1; i<n;原创 2011-08-04 11:29:59 · 563 阅读 · 0 评论 -
HDU 2899 求导+二分
http://acm.hdu.edu.cn/showproblem.php?pid=2899 指定区间不满足单调性 先求导 一阶导数=0的时候就是极大值或者极小值,先要把导数求取来,这时候的变量代进函数,就可以求出极值。具体问题还要看时间情况,是最大值还是最小值 #include #include #include #define eps 1e-7 double c原创 2011-07-16 17:33:28 · 435 阅读 · 0 评论