
二分法与STL
文章平均质量分 71
暮光乐鱼
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
hdu 2199 Can you solve this equation?
本题链接:http://acm.hdu.edu.cn/showproblem.php?pid=2199 本题用二分法查找,AC代码: #include #include double F(double x) { double s=8*x*x*x*x+7*x*x*x+2*x*x+3*x+6; return s; } int main() { int T; scan原创 2015-07-30 15:59:49 · 483 阅读 · 0 评论 -
hdu 2899 Strange fuction(二分+数学)
题目来源:hdu 2899 题目大意: 给出一个函数:F(x)=6 * x^7+8*x^6+7*x^3+5*x^2-y*x (0 <= x <=100);现在输入一个y值.(0 < Y <1e10),求此函数的最小值。 题目分析: 观察函数,我们可知,F(x)一阶导数为F’(x)=42 * x^6+48*x^5+21*x^2+10*x-y;而F’(x)中若不看原创 2015-08-24 20:55:22 · 843 阅读 · 0 评论 -
hdu 1950 Bridging signals
本题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1950 本题求的是所输数据按递增最多有多少个,用到了STL查找,AC代码: #include #include #include using namespace std; int a[40000]; int main() { int T; scanf("%d",&T);原创 2015-07-30 15:01:07 · 367 阅读 · 0 评论 -
hdu 2141 Can you find it?
本题链接:http://acm.hdu.edu.cn/showproblem.php?pid=2141 本题主要是用二分法查找,不然容易超时,注意输出格式!!! #include #include using namespace std; int a_l[510]; int b_n[510]; int c_m[510]; int d_ln[250100]; int main()原创 2015-07-30 20:09:03 · 421 阅读 · 0 评论 -
hdu 1551 Cable master
本题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1551 本题是给出电缆段数及每段长度,让求截出所给段数截得的每段的最大长度,AC代码: #include #include using namespace std; double a[10100]; int n,k; int F(double x) { int i; int su原创 2015-07-30 21:15:39 · 378 阅读 · 0 评论