Can you solve this equation?

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

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 -4
 
Sample Output
1.6152
No solution!
 
Author
Redow
 
Recommend
lcy   |   We have carefully selected several similar problems for you:  2899 2289 2298 2141 3400 
 
 
 /*
对于精度,我表示囧。
我以为,保留4位小数,就到1e-5就可以了。 */ #include<iostream>
#include<stdio.h>
#include<cstring>
#include<cstdlib>
#include<math.h>
using namespace std; double fun(double x)
{
return *x*x*x*x+*x*x*x+*x*x+*x+;
}
void EF(double l,double r,double Y)
{
double mid;
while(r-l>1e-)
{
mid=(l+r)/;
double ans=fun(mid);
if( ans >Y )
r=mid-1e-;
else l=mid+1e-;
}
printf("%.4lf\n",(l+r)/);
}
int main()
{
int T;
double Y;
scanf("%d",&T);
{
while(T--)
{
scanf("%lf",&Y);
if( fun(0.0)>Y || fun(100.0)<Y)
printf("No solution!\n");
else
EF(0.0,100.0,Y);
}
}
return ;
}

hdu 2199 Can you solve this equation? 二分的更多相关文章

  1. HDU 2199 Can you solve this equation?(二分精度)

    HDU 2199 Can you solve this equation?     Now,given the equation 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == ...

  2. HDU 2199 Can you solve this equation? (二分 水题)

    Can you solve this equation? Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K ( ...

  3. HDU - 2199 Can you solve this equation? 二分 简单题

    Can you solve this equation? Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K ( ...

  4. hdu 2199 Can you solve this equation?(高精度二分)

    http://acm.hdu.edu.cn/howproblem.php?pid=2199 Can you solve this equation? Time Limit: 2000/1000 MS ...

  5. HDU 2199 Can you solve this equation?(二分解方程)

    传送门: http://acm.hdu.edu.cn/showproblem.php?pid=2199 Can you solve this equation? Time Limit: 2000/10 ...

  6. ACM:HDU 2199 Can you solve this equation? 解题报告 -二分、三分

    Can you solve this equation? Time Limit: / MS (Java/Others) Memory Limit: / K (Java/Others) Total Su ...

  7. HDU 2199 Can you solve this equation(二分答案)

    Can you solve this equation? Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K ( ...

  8. HDU 2199 Can you solve this equation?【二分查找】

    解题思路:给出一个方程 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == Y,求方程的解. 首先判断方程是否有解,因为该函数在实数范围内是连续的,所以只需使y的值满足f(0)< ...

  9. hdu 2199 Can you solve this equation?(二分搜索)

    Can you solve this equation? Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K ( ...

随机推荐

  1. 查看npm安装包版本

    npm list 版本号. eg: npm list socket.io

  2. springMVC传递一组对象的接受方式

    受益此大神:https://blog.csdn.net/cgd_8523/article/details/80022331 同时借鉴代码!!!! 我只用了一种方法,就记下这一种 需求:前台存在动态添加 ...

  3. Tsung安装指南

    1. 所需要软件包unixODBC-2.2.14.tar.gzotp_src_R13B02-1.tar.gztsung-1.3.1.tar.gzTemplate-Toolkit-2.22.tar.gz ...

  4. 支付宝支付下载对账单bug反馈整理

    支付宝官方给广大开发朋友们,留了一个下载账单的API接口,供大家下载指定日期的账单数据.先来看下这个页面: 点我前往官方说明文档 $aop = new AopClient (); $aop->g ...

  5. PlistBuddy简单使用

    PlistBuddy简单使用 由于PlistBuddy并不在Mac默认的Path里,所以我们得通过绝对路径来引用这个工具: 查看帮助 /usr/libexec/PlistBuddy --help 下面 ...

  6. 用 diff 比较两个 hdfs 文件内容

    diff <(hadoop fs -cat /path/to/file) <(hadoop fs -cat /path/to/file2)

  7. 原创:centos7.1下 ZooKeeper 集群安装配置+Python实战范例

    centos7.1下 ZooKeeper 集群安装配置+Python实战范例 下载:http://apache.fayea.com/zookeeper/zookeeper-3.4.9/zookeepe ...

  8. hibernate关联关系的crud之级联

    cascade级联,只会影响CRUD的CUD,不会影响读取.不设置级联,从多的一方能读出一的一方,设了级联,从一的一方,默认也不能读出多的一方. 如果两个对象之间有关联,不管是一对多,多对一,单向还是 ...

  9. Django获取Header中的信息

    今天需要从header中获取一些信息,查了一些资料,需要注意一下几点: request.META.get("header key") 用于获取header的信息 注意的是heade ...

  10. CNN-利用1*1进行降维和升维

    降维: 比如某次卷积之后的结果是W*H*6的特征,现在需要用1*1的卷积核将其降维成W*H*5,即6个通道变成5个通道: 通过一次卷积操作,W*H*6将变为W*H*1,这样的话,使用5个1*1的卷积核 ...