HDOJ 题目2603 Wiskey's Power(数学)
2014-07-25 17:02
537 查看
Wiskey's Power
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 482 Accepted Submission(s): 210
[align=left]Problem Description[/align]
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.
![](https://oscdn.geek-share.com/Uploads/Images/Content/202009/24/5cee4bf100675abede30647a7bfaa565.jpg)
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:
![](https://oscdn.geek-share.com/Uploads/Images/Content/202009/24/3b522a88910b384bf9a01c0c321a3b67.jpg)
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)
[align=left]Input[/align]
Each line will contain three numbers V , m and a (0 <= a < 90)described above.
Process to end of file.
[align=left]Output[/align]
For each case, output Q in one line, accurate up to 3 decimal places.
[align=left]Sample Input[/align]
100 100 45
[align=left]Sample Output[/align]
3.992
[align=left]Author[/align]
WhereIsHeroFrom
[align=left]Source[/align]
HDU 1st “Vegetable-Birds Cup” Programming Open Contest
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2603
ac代码
#include<stdio.h> #include<math.h> int main() { double v,m,a; double pi=acos(-1.0); while(scanf("%lf%lf%lf",&v,&m,&a)!=EOF) { double vx,vy,t,sm,g=9.87,vm,t1,t2,vm2,s; a=a/180*pi; vy=v*sin(a); vx=v*cos(a); sm=vy*vy/(2*g); if(sm>0.5) { double t1=2*(vy-sqrt(vy*vy-2*0.5*g))/g; double t2=(sqrt(vy*vy+2*g*3)-vy)/g; t=t1+t2; } else { t=2*vy/g+(sqrt(vy*vy+2*g*3)-vy)/g; } s=vx*t; printf("%.3lf\n",s); } }
相关文章推荐
- HDOJ 题目2289 Cup(数学,二分)
- HDOJ 题目4832 Chess(DP,组合数学)
- HDOJ题目 4503 湫湫系列故事——植树节(数学)
- HDOJ题目2502月之数(数学,递推)
- HDOJ, 杭电1108, 最小公倍数题目,简单的数学题。。。。
- HDOJ 题目2058The sum problem(数学)
- HDOJ 题目2662 Coin(数学)
- HDOJ题目1392Surround the Trees(数学几何,凸包模板)
- HDOJ 题目1840 Equations(水,数学)
- hdu——2603——Wiskey's Power
- HDOJ 题目4651Partition(数学,五边形数定理)
- HDOJ 题目2306 改革春风吹满地(数学 几何)
- HDOJ 题目1722 Cake(数学)
- HDOJ 题目2303 The Embarrassed Cryptographer(数学)
- HDOJ题目1701ACMer(数学)
- HDOJ题目4705 Y(简单树形DP+数学)
- HDOJ题目1290献给杭电五十周年校庆的礼物(数学,递推)
- HDOJ 题目5496 Beauty of Sequence(数学)
- HDOJ 题目5100 Chessboard(数学乱搞)
- HDOJ题目1443Joseph(数学)