Solve the equation:

        p ∗ e −x + q ∗ sin(x) + r ∗ cos(x) + s ∗ tan(x) + t ∗ x 2 + u = 0

where 0 ≤ x ≤ 1.

Input

Input consists of multiple test cases and terminated by an EOF. Each test case consists of 6 integers in a single line: p, q, r, s, t and u (where 0 ≤ p, r ≤ 20 and −20 ≤ q, s, t ≤ 0). There will be maximum 2100 lines in the input file.

Output

For each set of input, there should be a line containing the value of x, correct up to 4 decimal places, or the string ‘No solution’, whichever is applicable.

Sample Input

0 0 0 0 -2 1

1 0 0 0 -1 2

1 -1 1 -1 -1 1

Sample Output

0.7071

No solution

0.7554

题意:给出一个方程,求解X;

思路:因为方程是单调递减的,所以二分求解;

 #include<iostream>
#include<cstdio>
#include<cmath>
#define EPS (10e-8)
using namespace std;
double p,q,r,s,t,u;
inline double fomula(double x){
return p*exp(-x)+q*sin(x)+r*cos(x)+s*tan(x)+t*x*x+u;
}
int main(){
while(scanf("%lf%lf%lf%lf%lf%lf",&p,&q,&r,&s,&t,&u)!=EOF){
double left=, right=, mid;
bool flag=false;
if(fomula(left)*fomula(right) > ){
printf("No solution\n");
continue;
}
while(right-left > EPS){
mid = (left+right)/;
if(fomula(mid)*fomula(left) > ) left=mid;
else right=mid;
} printf("%.4f\n", mid);
}
return ;
}

UVa - 12050 Palindrome Numbers (二分)的更多相关文章

  1. Uva - 12050 Palindrome Numbers【数论】

    题目链接:uva 12050 - Palindrome Numbers 题意:求第n个回文串 思路:首先可以知道的是长度为k的回文串个数有9*10^(k-1),那么依次计算,得出n是长度为多少的串,然 ...

  2. POJ2402/UVA 12050 Palindrome Numbers 数学思维

    A palindrome is a word, number, or phrase that reads the same forwards as backwards. For example,the ...

  3. UVa 12050 - Palindrome Numbers (回文数)

    A palindrome is a word, number, or phrase that reads the same forwards as backwards. For example, th ...

  4. UVA 12050 - Palindrome Numbers 模拟

    题目大意:给出i,输出第i个镜像数,不能有前导0. 题解:从外层开始模拟 #include <stdio.h> int p(int x) { int sum, i; ;i<=x;i+ ...

  5. UVa 10006 - Carmichael Numbers

    UVa 10006 - Carmichael Numbers An important topic nowadays in computer science is cryptography. Some ...

  6. Palindrome Numbers(LA2889)第n个回文数是?

     J - Palindrome Numbers Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu ...

  7. 2017ecjtu-summer training #1 UVA 12050

    A palindrome is a word, number, or phrase that reads the same forwards as backwards. For example, th ...

  8. UVa - 12050

    A palindrome is a word, number, or phrase that reads the same forwards as backwards. For example,the ...

  9. UVA.136 Ugly Numbers (优先队列)

    UVA.136 Ugly Numbers (优先队列) 题意分析 如果一个数字是2,3,5的倍数,那么他就叫做丑数,规定1也是丑数,现在求解第1500个丑数是多少. 既然某数字2,3,5倍均是丑数,且 ...

随机推荐

  1. ​Microchip SPI串行SRAM和NVSRAM器件

    Microchip的SRAM和NVSRAM系列(SPI串行SRAM和NVSRAM设备)提供了一种轻松添加外部RAM的方式,且具有以下特性功能 特性低功耗CMOS技术:4μA最大待机电流 标准4引脚SP ...

  2. maven 听视频笔记

    使用  pom.xml 配置 收藏 所听视频来源: https://www.bilibili.com/video/av54119831?p=8 视频: maven  idea 配置服务器 tomcat ...

  3. Luogu1738 | 洛谷的文件夹 (Trie+STL)

    题目描述 kkksc03是个非凡的空想家!在短时间内他设想了大量网页,然后总是交给可怜的lzn去实现. 洛谷的网页端,有很多文件夹,文件夹还套着文件夹. 例如:\(/luogu/application ...

  4. 在windows系统下,配置vue项目一键启动文件

    我的项目由客户端.后台管理.数据库和服务器三部分组件,每次启动项目都要一个一个启动,挺麻烦的,现在写一个.bat文件来批处理命令. 这个是我的启动文件内容. 第一行运行的我wampServer服务器, ...

  5. Redis 数据类型及操作

    前言 作为Key-value型数据库,Redis也提供了键(Key)和键值(Value)的映射关系.但是,除了常规的数值或字符串,Redis的键值还可以是以下形式之一: Lists (可重复列表) S ...

  6. 下载thinkphp5.0

    在服务器文件中右击Git_Bash_Here打开 在命令框写入 首先克隆下载应用项目仓库   git clone https://github.com/top-think/think tp5 tp5代 ...

  7. 使用faker 生成测试数据

    测试数据生成 faker基础使用 from faker import Faker f=Faker(locale='zh_CN') print(f.name()) address 地址 person 人 ...

  8. 使用这7个隐藏技巧让您的Mac更易于阅读和使用!

    macOS Mojave(10.15)可以说是苹果公司功能最强大,功能最强大的现代Mac软件更新版.它带来了一系列新功能,安全和隐私控制,稳定性增强以及Dark Mode主题! 它也代表了最易于使用的 ...

  9. openlayers添加弹出框

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  10. win10修改jupyter notebook默认路径

    安装anaconda3 ,因此自带jupyter notebook 发送到jupyter notebook到桌面快捷方式 右击属性,将目标的%USERPROFILE%,修该为自己需要的路径 起始位置修 ...