Codeforces VK Cup 2018 Div.2

General theme portal

I only passed 3 questions in this exam. The first three questions are not too difficult, but the code details of the third question stuck for me for two and a half hours (basically the whole exam), so in the future, I must manage the time reasonably and pay attention to the code. details, and refine my code style to make it more concise. (outside the game).

A: Simpler simulation questions, but note that S*2 is not required for the first flight.

B: Greedy problem. Obviously, we will block the largest Si value first, and then the next largest... So as long as Sort goes from large to small, it will not be blocked by pipe 1 to determine whether it meets the conditions.

C: Two points. Obviously, for a pair of points, the optimal point is obviously the point between them y, (if there is an elevator, of course choose the elevator). Otherwise, go to the points on both sides of them to select the optimal value. There are many details in this question, for example, if two points are in the same line, a special judgment is required (that's how I got hacked, at first, and then corrected in the game), and then if y>fy, it needs to be swapped. etc.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325130181&siteId=291194637