Untitled solution within the interceptor missile

A country in order to defend against enemy missile attacks, to develop a missile interception system. But such a missile interceptor system has a flaw: Although it's the first rounds to reach any height, but each shell and should not be higher than before the situation got height. One day, the radar picked up incoming enemy missiles. As the system is still in beta, so only a system, and therefore may not intercept all the missiles.

Enter the missile turn flying height (height of the radar data given is not a positive integer greater than 30,000, the number of missiles does not exceed 1000), the system calculated the maximum number of missiles to intercept, if you want to intercept all missiles to be equipped with a minimum number of sets this kind of missile interceptors.

A country in order to defend against enemy missile attacks, to develop a missile interception system. However, this system has an interceptor missile defective: although it is possible to reach the first rounds arbitrary height, and can be an arbitrary speed of the interceptor missile, but each out of the front shell not be higher than the height of the intercept missile flight speed can not be greater than the previous first serve. One day, the radar picked up incoming enemy missiles. As the system is still in beta, so only a system, and therefore may not intercept all the missiles.

In the case of not intercept all the missiles, of course we want to choose the country with minimal loss, which is the largest number of program to intercept missiles. But the number of interceptor missiles most likely to have multiple solutions, if there are multiple optimal solution, then we will randomly select a final interceptor missiles as a blueprint for action.

We spy has gained height and speed of all enemy missiles, your task is to calculate the probability in the implementation of the above decision, each missile was blocked off.

1. determination of probability through several programs

2. Consider each point, he was selected to his left lis program number is multiplied by the maximum length plus the right length equal to the maximum number of lis program, divided by the total number to

3. Code more details .... if not carefully think about when it will knock the code debugger to death

4. preorder cdq

5.cdq same direction merge state transition direction

6. Pay attention to the type of sort

7. All reassigned when dealing with each interval & sort happened because you do not know what the left subtree can not be described

Guess you like

Origin www.cnblogs.com/yxsplayxs/p/11280890.html