2 人解决,13 人已尝试。
2 份提交通过,共有 42 份提交。
9.8 EMB 奖励。
单点时限: 2.0 sec
内存限制: 256 MB
You are watching a car race. Each car starts a different point on the x-axis, travels at the same speed, and starts at the same time. However, each car is travelling along a different road (which extends to infinity in one direction, and is stopped by the x-axis in the other direction), and each road has its own direction specified by an angle between 1 and 179, inclusive. An angle of 90 indicates that the road heads directly in the positive y direction, while an angle of 1 indicates that the road heads just a little bit north of the positive x direction. Note that cars never head in the negative y direction.
Sometimes, two or more roads intersect at some point. When this happens, the car that reaches the intersection first is able to block the intersection so that no other cars can pass through it. If two cars reach an intersection at the same time, the one with the lower index passes, while the other one is blocked.
In picture two, the cars following the red paths make it through all of the intersections, while the cars on the gray paths are blocked.
There are many test case.Each test case you will be given a interger n then n(1<=n<=1000)angles, where the ith element of angles is the angle between the x-axis and the road that the ith car drives on, in degrees. The order of the elements of angles corresponds to the order of the cars along the x-axis (no two cars start at the exact same location), with the first element of angles corresponding to the car with the leftmost starting position on the x-axis.
-Each elemtent of angles will be between 1 and 179, inclusive.
Output some interger containing the 0-based indices of all the cars that will pass all of the intersections along their roads. Your answer should be sorted in ascending order.
Note that the exact locations of the cars along the x-axis do not matter. All that matters is their order, and the directions in which they head.
6 105 75 25 120 35 75 5 179 89 90 91 1
0 1 5 0 2 4
2 人解决,13 人已尝试。
2 份提交通过,共有 42 份提交。
9.8 EMB 奖励。
创建: 16 年,7 月前.
修改: 7 年,2 月前.
最后提交: 14 年,2 月前.
来源: N/A