hdu 2603
来源:互联网 发布:全本小说软件下载 编辑:程序博客网 时间:2024/06/06 11:48
Wiskey's Power
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 341 Accepted Submission(s): 156
Problem Description
Come back school from the 33rdACM / ICPC Asia ChenDu, everyone is exhausted, in particular the captain Wiskey. As saying that night, Wiskey drink a lot of wine, just as he blurred, fall to sleep. All of a sudden, Wiskey felt a slight discomfort in the chest, and then vomiting, vomitted all over. The next day, Wiskey is extremely sluggish, vomit still on the train.
Your task is to calculate the coordinates of vomit.
We assume that the quality of vomit is m, and its size can be ignored.
As the figure below:
The vomit start from the blue point A, whose speed is V, and its angle with X-axis is a. If the vomit hit the ceiling, then its value of the speed don't changed and if before the collision the angle of the speed with X-axis is b, then after the collision the angle of the speed with X-axis is b , too.
Ignore air resistance, acceleration due to gravity g = 9.87m/s2, calculate and output Q.
(you can assume that the vomit will not fall to the higher berth)
Your task is to calculate the coordinates of vomit.
We assume that the quality of vomit is m, and its size can be ignored.
As the figure below:
The vomit start from the blue point A, whose speed is V, and its angle with X-axis is a. If the vomit hit the ceiling, then its value of the speed don't changed and if before the collision the angle of the speed with X-axis is b, then after the collision the angle of the speed with X-axis is b , too.
Ignore air resistance, acceleration due to gravity g = 9.87m/s2, calculate and output Q.
(you can assume that the vomit will not fall to the higher berth)
Input
Each line will contain three numbers V , m and a (0 <= a < 90)described above.
Process to end of file.
Process to end of file.
Output
For each case, output Q in one line, accurate up to 3 decimal places.
Sample Input
100 100 45
Sample Output
3.992
Author
WhereIsHeroFrom
Source
HDU 1st “Vegetable-Birds Cup” Programming Open Contest
Recommend
lcy
计算出S=忽略天花板能到达的距离;然后列方程,计
算出轨道抛物线和天花板是否有交点,有两个交点的话,
S-=两个交点的距离。输出S即可。
#include"stdio.h"#include"string.h"#include"math.h"#define g 9.87int main(){double v,m,ang;double v_c,v_s;double a,b,c,dir;double ans;while(scanf("%lf%lf%lf",&v,&m,&ang)!=-1){ang=ang*3.1415927/180;v_s=v*cos(ang);v_c=v*sin(ang);ans=v_s*(v_c/g+sqrt(2*(3+0.5*v_c*v_c/g)/g));a=g/2/v_s/v_s;b=-(v_c/v_s);c=0.5;dir=b*b-4*a*c;if(dir<0)printf("%0.3lf\n",ans);elseprintf("%0.3lf\n",ans-sqrt(dir)/a);}return 0;}
转载自http://blog.csdn.net/ice_crazy/article/details/8037778
- hdu 2603
- hdu-2603
- hdu
- hdu
- HDU
- hdu ()
- hdu
- hdu
- HDU
- HDU
- hdu
- hdu
- HDU
- Hdu
- hdu
- hdu-
- hdu
- hdu
- cassandra (1) What's new
- udp并发问题分析与总结
- Sql数据库字段类型
- 工作变得简单又高效 试试这八个WebApp
- VC项目设置Unicode和多字节
- hdu 2603
- const char*, char const*, char*const的区别
- ASP.NET 可编辑的下拉框(DropDownList)
- 12个有趣的C语言问答
- IE6下 float:right 后换行的问题
- [工作问题总结]MyEclipse 打开项目
- Cocos2d-x 屏幕适配新解
- 使用GridView和ImageView组件实现图片显示效果
- SSH开发注意事项