day5 HDU 2899 Strange fuction
来源:互联网 发布:js实现excel上传文件 编辑:程序博客网 时间:2024/06/07 11:08
写好公式三分就可以了,注意精度设置
#include"iostream"#include"iomanip"#include"math.h"using namespace std;double F(double x,double y){ return 6*x*x*x*x*x*x*x+8*x*x*x*x*x*x+7*x*x*x+5*x*x-y*x;}double find(double y){ double l,r,mid,mmid,p,q; l=0; r=100; while(l+0.00001<r) { mid=(l+r)/2.0; mmid=(mid+r)/2.0; p=F(mid,y); q=F(mmid,y); if(p<q)r=mmid; else l=mid; } return mid;}int main(){ int t; double y,k; cin>>t; while(t--) { cin>>y; cout<<fixed<<setprecision(4)<<F(find(y),y)<<endl; } return 0;}
0 0
- day5 HDU 2899 Strange fuction
- HDU 2899 Strange fuction
- hdu 2899 Strange fuction
- hdu 2899 Strange fuction
- HDU 2899 Strange fuction
- hdu 2899 Strange fuction
- HDU 2899-Strange fuction
- hdu 2899 Strange fuction
- hdu--2899--Strange fuction
- hdu 2899 Strange fuction
- HDU 2899 Strange fuction
- HDU 2899 Strange fuction
- hdu 2899 Strange fuction
- hdu 2899 Strange fuction
- HDU 2899 Strange fuction
- HDU 2899 Strange fuction
- hdu 2899 Strange fuction
- Strange fuction ----HDU 2899
- day4 CodeForces 616A Comparing Two Long Integers
- Python学习笔记1
- HDU-2444 The Accomodation of Students(二分图判断+最大二分匹配)
- Java子类实例化过程和Java方法重写与super关键字
- 2029--回文字符串
- day5 HDU 2899 Strange fuction
- 海量数据的算法
- 树莓派 Step by step
- canvas 画布、缓存的相关内容
- cannot resolve method 'open()'显示红色,方法不可用解决方法
- day5 HDU 2298 Toxophily
- java-优化-代码优化(2)
- iOS项目的bug统计
- CodeForces 148D Bag of mice(概率DP)