第一次接触三分!
来源:互联网 发布:网店关键词优化 编辑:程序博客网 时间:2024/05/21 06:50
Turn the corner
Time Limit : 3000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)
Total Submission(s) : 34 Accepted Submission(s) : 17
Problem Description
Mr. West bought a new car! So he is travelling around the city.<br><br>One day he comes to a vertical corner. The street he is currently in has a width x, the street he wants to turn to has a width y. The car has a length l and a width d.<br><br>Can Mr. West go across the corner?<br><img src=../../../data/images/2438-1.jpg><br>
Input
Every line has four real numbers, x, y, l and w.<br>Proceed to the end of file.<br>
Output
If he can go across the corner, print "yes". Print "no" otherwise.<br>
Sample Input
10 6 13.5 4<br>10 6 14.5 4<br>
Sample Output
yes<br>no<br>
Source
2008 Asia Harbin Regional Contest Online
以后
保证
做一个题
写一个博客!
不然 又忘了题意
#include<set>#include<stdio.h>#include<vector>#include<algorithm>#include<numeric>#include<math.h>#include<string.h>#include<sstream>#include<stdio.h>#include<string>#include<cstdlib>#include<algorithm>#include<iostream>#include<map>#include<queue>using namespace std;double pi=acos(-1.0); double x,y,l,w; double pao(double g) { return l*cos(g)+(w-x*cos(g))/sin(g); } double paopao(double x1, double x2) { double t1,t2; double x3,x4; while(1) { x3=((2*x1)+x2)/3; x4=(x1+(2*x2))/3; t1=pao(x3); t2=pao(x4); if(t1<t2) { x1=x3; } else { x2=x4; } if(fabs(x2-x1)<1e-4) { return x2; break; } } }int main(){ double pao1,pao2; while(cin>>x>>y>>l>>w) { pao1=0; pao2=pi/2; double hehe; hehe=paopao(pao1,pao2); if(pao(hehe)<=y) { cout<<"yes"<<endl; } else { cout<<"no"<<endl; } } return 0;}
有得找
0 0
- 第一次接触三分!
- 第一次接触
- 第一次接触
- 第一次亲密接触
- 第一次接触blog
- 第一次亲密接触 .net
- Blog的第一次接触
- 第一次亲密接触
- 第一次接触Delphi
- 第一次亲密接触
- 今天第一次接触Java
- 第一次 接触 csdn
- 第一次亲密接触Blog!
- 第一次的亲密接触!
- ADO第一次亲密接触
- 第一次接触blog
- ADO第一次亲密接触
- 第一次的亲密接触
- Apache虚拟主机的配置
- 三角问题
- Git版本控制工具-----远程仓库GitHub的使用
- node.js学习总结
- javaScript学习<一>
- 第一次接触三分!
- java实现钱数数字到大写的转换联系
- 乌云章华鹏:如何构建高效安全的运维服务平台
- LeetCode *** 108. Convert Sorted Array to Binary Search Tree
- 分类模型的性能评估——以SAS Logistic回归为例(1): 混淆矩阵
- 三分 2
- 通过GSON解析json
- C#面向对象
- 三分 3