【二分查找】
AresDLEX
Ares does not fall
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU 2199 Can you solve this equation
1、二分查找,水题。 2、在0和100中二分找到0点(r-l范围在1e-6间视为0) #include<cstdio> #include<iostream> #include<cmath> using namespace std; double func(double x) { //数值 return 8*pow(x,4)+7*pow(x,3)+2...原创 2018-10-22 13:27:33 · 191 阅读 · 0 评论 -
HDU 2899 Strange Function
1、二分查找常规操作,水题。 2、求导可知导函数在[0,100]内单增,[0,100]导函数有0点为函数先减后增,既导函数为0时,此处函数值最小。 3、就其实我觉得可以了解一下stl的binarySearch函数。 #include<cstdio> #include<iostream> #include<cstring> #include<cmat...原创 2018-10-22 13:55:29 · 506 阅读 · 0 评论
分享