【HDU-6373】解题报告(物理力学,模拟,2018杭电多校第六场)
原始题目
Pinball
- Time Limit: 2000/1000 MS (Java/Others)
- Memory Limit: 262144/262144 K (Java/Others)
- Total Submission(s): 604
- Accepted Submission(s): 264
Problem Description
There is a slope on the 2D plane. The lowest point of the slope is at the origin. There is a small ball falling down above the slope. Your task is to find how many times the ball has been bounced on the slope.
It's guarantee that the ball will not reach the slope or ground or Y-axis with a distance of less than 1 from the origin. And the ball is elastic collision without energy loss. Gravity acceleration \(g=9.8m/s^2\).
Input
There are multiple test cases. The first line of input contains an integer T (1 ≤ T ≤ 100), indicating the number of test cases.
The first line of each test case contains four integers a, b, x, y (1 ≤ a, b, -x, y ≤ 100), indicate that the slope will pass through the point(-a, b), the initial position of the ball is (x, y).
Output
Output the answer.
It's guarantee that the answer will not exceed 50.
Sample Input
1
5 1 -5 3
Sample Output
2
Source
2018 Multi-University Training Contest 6
Recommend
chendu
题目大意
- 给定一个从原点向一个方向延长的斜板,以及初始小球的坐标,重力加速度。求能在斜板上弹跳几次(不考虑能量损失)
解题思路
- 物理题,把运动分解成沿板方向和垂直于板的方向的分运动,求出沿板子运动的时间\(t1\),垂直于板子运动的(每一次上升/下降)的时间\(t2\)。
- 考虑一下,当$(2n+1)t2 t1 < (2(n+1)+1)t2 $ 时,n即为答案
解题代码
1 |
|
收获与反思
- 分运动看时间比判断,队友想出来的= =。
本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!