HDU 2199 Can you solve this equation?
来源:互联网 发布:微信朋友圈数据采集 编辑:程序博客网 时间:2024/06/05 07:26
#include<cstdio>#include<cmath> #define eps 1e-8double l = 0, r = 100, mid, y, ans;double f(double x){return 8 * pow(x, 4) + 7 * pow(x, 3) + 2 * pow(x, 2) + 3 * x + 6;}int main(){int T;scanf("%d", &T);while (T--){l=0;r=100;scanf("%lf", &y);if (f(l)>y || f(r)<y) //因为该函数在[0,100]上递增{printf("No solution!\n");continue;}while (r-l>eps){mid = (l + r) / 2;if (f(mid)>y) r = mid;if (f(mid)<y) l = mid;}printf("%.4f\n", l);}return 0;}
阅读全文
0 0
- hdu 2199 Can you solve this equation?
- hdu 2199 Can you solve this equation?
- hdu 2199 Can you solve this equation?
- HDU 2199 Can you solve this equation?
- hdu 2199 Can you solve this equation?
- HDU 2199-Can you solve this equation?
- hdu 2199 Can you solve this equation?
- hdu 2199 can you solve this equation
- HDU 2199 Can you solve this equation?
- HDU 2199 Can you solve this equation?
- hdu 2199 Can you solve this equation?
- HDU 2199 Can you solve this equation?
- HDU 2199 Can you solve this equation?
- HDU 2199 Can you solve this equation?
- hdu 2199 Can you solve this equation?
- hdu 2199 Can you solve this equation?
- hdu 2199 Can you solve this equation
- hdu-2199 Can you solve this equation?
- Intellij IDEA配置优化
- Monthly Expense--CSU-ACM2017暑假集训2-二分搜索
- 记住密码功能的制作
- Java包装类
- 50天iOS挑战(Swift)
- HDU 2199 Can you solve this equation?
- python实现SMTP客户端
- 嫌Word转换太麻烦!那是你没选对转换工具
- [RK3288][Android6.0] WiFi之网络时间定期同步更新
- xml与map之间互转(java)
- [转]详解C指针
- 补题: 1001. Add More Zero 1011KazaQ's Socks
- python多线程学习总结
- yii2 composer安装 高级应用