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. 【flask macro】No caller defined

    https://segmentfault.com/q/1010000005352059/a-1020000005352912 先码着 有时间了再换成caller() 先用老方法吧...

  2. flask后端获取前端post/get数据

    post:用request.form 而且要加上return !!记着加上return get:用 request.args()就可以了

  3. declare命令

    还是围绕以下几个问题进行学习; 1.declare是什么? 2.问什么要用declare? 3.怎样使用declare? 1.declare是什么? ♦declare应用的很多,向我们各种语言都会有声 ...

  4. Leetcode 88 合并两个有序数组 Python

    合并两个有序数组 给定两个有序整数数组 nums1 和 nums2,将 nums2 合并到 nums1 中,使得 num1 成为一个有序数组. 说明: 初始化 nums1 和 nums2 的元素数量分 ...

  5. 如何在CentOS 7上使用vsftpd(FTP)的配置文件介绍

    vsftpd.conf - vsftpd的配置文件. 描述 vsftpd.conf可用于控制vsftpd行为的各个方面. 默认情况下,vsftpd在/etc/vsftpd.conf位置查找此文件. 但 ...

  6. SpringBoot整合MyBatis及Thymeleaf

    http://www.cnblogs.com/ludashi/archive/2017/05/08/6669133.html 上篇博客我们聊了<JavaEE开发之SpringBoot工程的创建. ...

  7. day 12 课后作业

    # -*- coding: utf-8 -*-# @Time : 2019/1/4 20:49# @Author : Endless-cloud# @Site : # @File : day 12 课 ...

  8. day 09 课后作业

    # -*- coding: utf-8 -*-# @Time : 2018/12/28 14:25# @Author : Endless-cloud# @Site : # @File : 08 课后作 ...

  9. (RaspBerry Pi) Python GPIO 基本操作

    目前打算由潛入深慢慢學習RaspBerry Pi, 所以先由最容易下手的Python進入樹莓派的世界 首先要使用 GPIO 需要利用RPI.GPIO package想當然爾必須先安裝 所以先執行下列命 ...

  10. 多线程atomicInteger

    并发编程的3个重要概念 1.原子性: 一个操作或者多个操作,要么全部成功,要么全部失败 1.java中保证了基本数据类型的读取和赋值,保证了原子性,这些操作不可终端 a=10 原子性 b=a 不满足 ...