hdu2199
2015-07-15 21:03
357 查看
典型的二分。。。然而当初 搞了一上午
[code]#include<iostream> #include<cstdio> #include<cmath> using namespace std; double Y; double cal(double x) { return 8.0*x*x*x*x+7.0*x*x*x+2.0*x*x+3.0*x+6.0; } int main() { int T; scanf("%d",&T); while(T--) { scanf("%lf",&Y); if(Y<6||Y>807020306) { printf("No solution!\n"); continue; } double l=0.0,r=100.0,mid; while(r-l>1e-8) { mid=(l+r)*0.5; if(cal(mid)>Y) { r=mid; } else { l=mid+1e-8; } } printf("%.4lf\n",mid); } }
相关文章推荐
- ubuntu 重新安装mysql
- POJ 3615 Cow Hurdles //Floyd算法
- Chrome谷歌浏览器如何禁用JavaScript
- iOS中的c第二天分支语句
- bzoj1146
- Codeforces Round #202 (Div. 2) C. Mafia
- Nginx 定义自己的 http 模块
- 安卓开班自我介绍
- Android之——多线程断点续传下载示例
- 4.3堆积面积图
- SVN合并(merge)的使用
- matlb中如何设置坐标轴的参数以及进行绘图的如何进行注释
- Rectangle Area
- bzoj1143
- zoj 3643 Keep Deleting
- OpenGL画线和直方图笔记
- C#畅谈“网络电视”
- zoj2112
- Jakarta-Commons- BeanUtils学习笔记:
- 【Go语言】【14】GO语言的接口类型