D - Can you solve this equation?

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.

InputThe 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);OutputFor 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!


 #include<iostream>
#include<cmath>
using namespace std; double f(double x){
return (*pow(x,) + *pow(x,) + *pow(x,) + *x + );
} int main()
{
int t;
double m,n;
scanf("%d",&t);
while(t--){
scanf("%lf",&m);
if(f()>m||f()<m){
printf("No solution!\n");
continue;
}
double left = , right = , mid;
while(fabs(f(mid)-m) > 1e-){
mid=(left + right)/;
if((f(mid) > m)) right = mid;
else if(f(mid)<m) left=mid;
}
printf("%.4lf\n",mid);
}
return ;
}

二分-D - Can you solve this equation?的更多相关文章

  1. 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 ...

  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? 二分 简单题

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

  5. hdu2199Can you solve this equation?(解方程+二分)

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

  6. 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 ...

  7. hdoj 2199 Can you solve this equation?【浮点型数据二分】

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

  8. Can you solve this equation?(二分)

    Can you solve this equation? Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 32768/32768K (Ja ...

  9. 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 == ...

随机推荐

  1. Anaconda使用教程全攻略

    Anaconda使用教程全攻略 本文转自 https://zhuanlan.zhihu.com/p/32925500           〇.序 Python是一种面向对象的解释型计算机程序设计语言, ...

  2. vue搭建手顺

    1.环境准备:node.js  vue-cli: $ npm install vue-cli -g 2.建立项目目录:vuedemo,并cd到该目录下 3.$ vue init webpack  vu ...

  3. CSS背景说明及连写

    一.CSS背景说明 CSS 可以添加背景颜色和背景图片,以及来进行图片设置. 1.1 背景图片(image) background-image 属性允许指定一个图片展示在背景中(只有CSS3才可以多背 ...

  4. Django如何连接mysql

    1.设置django的mysql驱动为pymysql 因为django默认的是使用MySqlDb连接mysql数据库,但是由于该模块不支持python3.4以上版本,所以使用pymysql模块 在项目 ...

  5. 转:Flutter开发中踩过的坑

    记录一下入手Flutter后实际开发中踩过的一些坑,这些坑希望后来者踩的越少越好.本文章默认读者已经掌握Flutter初步开发基础. 坑1问题:在debug模式下,App启动第一个页面会很慢,甚至是黑 ...

  6. 【笔记】机器学习 - 李宏毅 - 9 - Keras Demo

    3.1 configuration 3.2 寻找最优网络参数 代码示例: # 1.Step 1 model = Sequential() model.add(Dense(input_dim=28*28 ...

  7. JMeter接口测试-JMeter+ant实现接口自动化测试

    前言 小伙伴们,用python做接口自动化是不是写代码比较繁琐,而且没有python代码基础的小伙伴根本无从下手对吧!今天我们来学习一下如何使用JMeter工具实现接口自动化测试. 1.安装JDK,配 ...

  8. 小白的java学习之路 “ 选择结构(一)”

    if选择结构: if选择结构是根据条件判断之后再做处理的一种语法结构. 1.if选择结构的语法: public class Demo{ public static void main(String[] ...

  9. Windows玩转Kubernetes系列4-搭建K8S Dashboard

    下载官方yaml文件 最新的配置文件v2.0.0-beta8版本recommended.yaml,UI地址 wget https://raw.githubusercontent.com/kuberne ...

  10. .net mvc中epplus导出excel

    帮助类 using OfficeOpenXml; using OfficeOpenXml.Style; using System; using System.Collections.Generic; ...