日本搞逼视频_黄色一级片免费在线观看_色99久久_性明星video另类hd_欧美77_综合在线视频

國內(nèi)最全IT社區(qū)平臺 聯(lián)系我們 | 收藏本站
阿里云優(yōu)惠2
您當前位置:首頁 > php開源 > php教程 > 杭電 HDU ACM 2199 Can you solve this equation?

杭電 HDU ACM 2199 Can you solve this equation?

來源:程序員人生   發(fā)布時間:2015-05-08 07:46:43 閱讀次數(shù):2866次

Can you solve this equation?

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 11180    Accepted Submission(s): 5151


Problem Description
Now,given the equation 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == Y,can you find its solution between 0 and 100;
Now please try your lucky.
 

Input
The first line of the input contains an integer T(1<=T<=100) which means the number of test cases. Then T lines follow, each line has a real number Y (fabs(Y) <= 1e10);
 

Output
For each test case, you should just output one real number(accurate up to 4 decimal places),which is the solution of the equation,or “No solution!”,if there is no solution for the equation between 0 and 100.
 

Sample Input
2 100 ⑷
 

Sample Output
1.6152 No solution!
 

Author
Redow
 
 
搜索題,嗯, 這次知道了有個搜索名次,2分搜索。這樣查找答案確切感覺特別妙。low 和high 無窮夾逼答案。所以由于最后結(jié)果只需滿足1定的精確度。這樣可以找到適合的條件跳出while。
唉,如果不知道這樣的話,浮點數(shù)暴力簡直無語了都。
#include<iostream> #include<cmath> #include<stdio.h> using namespace std; double A(double x) { return (8*pow(x,4)+7*pow(x,3)+2*pow(x,2)+3*pow(x,1)+6); } int main() { double y; int T; cin>>T; while(T--) { cin>>y; if(A(0)>y||A(100)<y) { cout<<"No solution!"<<endl; continue; } else{ double high,low,mid; high=100; low=0; while(low+1e⑻<high) { mid=(high+low)/2; if(A(mid)>y) high=mid; else low=mid; } printf("%.4lf ",low); } } return 0; }

 
生活不易,碼農(nóng)辛苦
如果您覺得本網(wǎng)站對您的學(xué)習(xí)有所幫助,可以手機掃描二維碼進行捐贈
程序員人生
------分隔線----------------------------
分享到:
------分隔線----------------------------
關(guān)閉
程序員人生
主站蜘蛛池模板: 国产成人99久久亚洲综合精品 | 玖玖玖视频 | 欧美性受 | 国产精品免费在线 | 最新av网站在线观看 | 亚洲国产精品女人久久久 | 国产一区二区三区不卡在线观看 | 成人在线免费电影 | 国产小视频在线播放 | 91久久国产综合久久91猫猫 | 亚洲最大av网| 日本精品在线视频 | 五月婷婷六月丁香 | 狼人综合视频 | 一区二区三区不卡视频在线观看 | 免费视频一区二区 | 欧美日韩国产二区 | 久久精品网站免费观看 | 在线观看毛片网站 | 精品乱人伦一区二区三区 | 亚洲精品一区二区网址 | 精品久久久久久亚洲综合网 | 精品一区二区三区中文字幕 | 天堂在线中文资源 | 久久精品播放 | 美女航空一级毛片在线播放 | 欧美综合成人网 | 日韩在线中文字幕 | 正在播放一区 | 欧美日韩亚洲不卡 | 麻豆精品国产91久久久久久 | 自拍偷拍在线视频 | 国产三级毛片 | 97成人在线视频 | 亚洲国产97在线精品一区 | 福利国产 | 欧美日韩国产一区二区三区 | 国产激情美女久久久久久吹潮 | 国产激情一区二区三区 | 大桥未久中文字幕 | 亚洲自拍电影 |