#P1020. [NOIP 1999 提高组] 导弹拦截
[NOIP 1999 提高组] 导弹拦截
Description
To defend against enemy missile attacks, a country developed a missile interception system. However, this system has a flaw: although the first shell can reach any height, each subsequent shell cannot be higher than the previous one. One day, the radar detected incoming enemy missiles. Since the system is still in the trial phase, there is only one set available, so it might not be able to intercept all missiles.
Given the heights of the incoming missiles in order, compute the maximum number of missiles this system can intercept, and the minimum number of such missile interception systems needed to intercept all missiles.
Input Format
One line containing several integers separated by spaces.
Output Format
Two lines, one integer per line. The first number is the maximum number of missiles this single system can intercept. The second number is the minimum number of such systems required to intercept all missiles.
389 207 155 300 299 170 158 65
6
2
Hint
For the first of the testdata (NOIP original testdata), the number of missiles does not exceed . This part contributes points in total. An algorithm can pass.
For the remaining of the testdata, the number of missiles does not exceed . This part also contributes points in total. Please use an algorithm to pass.
For all testdata, missile heights are positive integers not exceeding .
In addition, this problem enables SPJ; there are two sub-questions per test point, and scoring is per sub-question.
NOIP 1999 Senior Problem 1.
:A new hack testdata has been added.
Translated by ChatGPT 5
京公网安备 11011102002149号