当前位置:网站首页>UVA10341 Solve It
UVA10341 Solve It
2022-07-19 16:46:00 【༺Blog༒Hacker༻】
Personal profile
Hello everyone , I am a 2022 year 3 Ranked third in the rookie list in January ༺Blog༒Hacker༻
Stand by me : give the thumbs-up + Collection ️+ Leaving a message.
Maxim :༺ Always do high quality ༒programmer༻
Series column :CF & UVA
Personal home page :༺Blog༒Hacker༻️

notes ( Please refer to CF665B Shopping):
️ my Update time It's going to change , monthly 2-5 piece , Thank you for your long-term support !
UVA10341 Solve It
️ English Title Description

️ Title Translation
️ Solve the equation shown below : p × e − x + q × sin ( x ) + r × cos ( x ) + s × tan ( x ) + t × x 2 + u = 0 p\times e^{-x}+q\times\sin(x)+r\times\cos(x)+s\times\tan(x)+t\times x^2+u=0 p×e−x+q×sin(x)+r×cos(x)+s×tan(x)+t×x2+u=0
among p , q , r , s , t , u p,q,r,s,t,u p,q,r,s,t,u by Parameters , 0 ≤ x ≤ 1 0≤x≤1 0≤x≤1 .
️ Input format : Input p , q , r , s , t , u p,q,r,s,t,u p,q,r,s,t,u
️ Output format : The solution of the equation , If there is no solution, output No solution.
️ Data range : 0 ≤ p , r ≤ 20 0≤p,r≤20 0≤p,r≤20 and − 20 ≤ q , s , t ≤ 0 −20≤q,s,t≤0 −20≤q,s,t≤0.
️ I/o sample
Input #1
0 0 0 0 -2 1
1 0 0 0 -1 2
1 -1 1 -1 -1 1
Output #1
0.7071
No solution
0.7554
CODE
#include<bits/stdc++.h>
using namespace std;
const double eps=1e-10;
double p,q,r,s,t,u,L,R,mid;
inline double f(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)!=-1)
{
L=0,R=1;
if(f(L)*f(R)>0)
{
printf("No solution\n");
continue;
}
while(R-L>=eps)
{
mid=(L+R)/2;
if(f(mid)>0) L=mid;
else R=mid;
}
printf("%.4f\n",L);
}
return 0;
}

Thank you for your long-term support , Like collection is my motivation to update , See you next time , Bye-bye !!!

边栏推荐
- 51how does world modify the size of the rendered video / window?
- 记录使用mRemoteNG软件启动后无法进行复制粘贴
- PDF合并后的PDF页面大小不一的解决方法
- TCP/IP协议栈Lwip的设计与实现:之四
- Nacos服务部署安装
- 【日常训练】565. 数组嵌套
- 开发idea插件在提交审核时因为兼容性问题未通过
- Entropy technology passed the registration: the annual revenue was 1.955 billion, and the book balance of accounts receivable was 290million
- 数据湖(十三):Spark与Iceberg整合DDL操作
- Mycat2 start message [mycat-3036][err_init_config] start filemetadatastoragemanager fail
猜你喜欢

What is graph neural network?

Quick review of interview (II): why is cross entropy useful

关于使用apksigner.bat对APK进行重新签名记录

Vs2019 MFC slider control control inherits csliderctrl class to redraw self paint

向数据库表中插入中文数据报错“1366 (HY000): Incorrect string value: ‘\xE5\x90\x95\xE5‘ for column ‘name‘ at row 1“

Entropy technology passed the registration: the annual revenue was 1.955 billion, and the book balance of accounts receivable was 290million

【VScode输出为乱码】解决方法

The IPO of Aoyang technology was terminated: the annual revenue was 800million, and Su Wei held 67.5% equity

nacos集群搭建

数据湖(十三):Spark与Iceberg整合DDL操作
随机推荐
JMeter 21 day clock in day08
Vs2019 MFC dynamically creates edit control, csliderctrl class member function create application creates slider control control [mfc dynamically creates control 4]
Et working mode and lt working mode of epoll
06. Binary tree and simple application
CSDN認證C1級別學習筆記 - Web進階篇
nacos集群搭建
数据湖(十三):Spark与Iceberg整合DDL操作
Solutions to the different sizes of PDF pages after PDF merging
【Unity3D】UGUI之布局组件
【Linux】 CentOS 7.5 离线环境安装MySQL5.7.30
The development idea plug-in failed to pass the audit due to compatibility problems
QA机器人召回优化
面试题 01.04. 回文排列-辅助数组法
向数据库表中插入中文数据报错“1366 (HY000): Incorrect string value: ‘\xE5\x90\x95\xE5‘ for column ‘name‘ at row 1“
StarRocks 成都见!企业如何打造极速统一的数据分析新范式,助力业务全方位升级
call,apply,bind的实现
【C语言】文件操作详解
Notes d'apprentissage de niveau C1 certifiées csdn - web Advanced
Gesture recognition dataset: Jester dataset decompression
The fourth day of MATLAB learning (decision statement)