HDU2199 Can you solve this equation?(二分)
来源:互联网 发布:美国零售销售数据公布 编辑:程序博客网 时间:2024/05/21 17:06
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2199
二分最简单的应用
#include<stdio.h>#include<math.h>double cal(double x){ return 8*x*x*x*x+7*x*x*x+2*x*x+3*x+6;}int main(){ int t; scanf("%d",&t); while(t--) { double n; scanf("%lf",&n); if(cal(0)>n||cal(100)<n) { printf("No solution!\n"); continue; } double l=0.0,r=100.0; double mid=(l+r)/2; while(fabs(cal(mid)-n)>1e-5) { if(cal(mid)>n) r=mid; else l=mid; mid=(l+r)/2; } printf("%.4lf\n",mid); } return 0;}
2 0
- HDU2199:Can you solve this equation?(二分)
- HDU2199 Can you solve this equation?(二分)
- hdu2199 Can you solve this equation? (二分搜索)
- hdu2199 Can you solve this equation? (二分+double精度)
- hdu2199 Can you solve this equation?(二分)
- 【hdu2199】Can you solve this equation?——二分
- HDU2199:Can you solve this equation?(数学 + 二分)
- 二分搜索--控制精度--hdu2199 Can you solve this equation
- HDU2199 Can you solve this equation?
- hdu2199 Can you solve this equation?
- HDU2199 Can you solve this equation?
- hdu2199 Can you solve this equation?
- (step4.1)hdu2199(Can you solve this equation?——二分查找)
- ACM-二分搜索之Can you solve this equation?——hdu2199
- HDU2199 Can you solve this equation 二分求方程的根
- hdu2199 Can you solve this equation?(二分查找,多项式求解)
- 【个人训练】(HDU2199)Can you solve this equation?
- Can you solve this equation?(二分)
- 将图像绘制成3维立体散点图
- 链表实现的线性表
- Android Dalvikvm的使用
- Python系列之 - 初识Python
- WebGoat实验环境搭建 - 2016.01.01
- HDU2199 Can you solve this equation?(二分)
- Maven学习系列--08一个HelloWorld的web应用
- java实现人民币大写
- 函数常识
- PyCharm的注册与使用
- 106_Prime 最小生成树
- 积分墙、广告等违规应用如何在安卓市场上线
- (4)java的数据类型
- DrTM durability