#P1803. 凌乱的yyy / 线段覆盖
凌乱的yyy / 线段覆盖
Description
There are contests on various OJ sites, and the start and end times of each contest are known.
yyy believes that the more contests he attends, the better he will do in NOIP (not really). So, he wants to know the maximum number of contests he can attend.
Since yyy is a "juruo" (rookie), if he decides to attend a contest, he must see it through from start to finish, and he cannot attend or more contests at the same time.
Input Format
The first line contains an integer . The next lines each contain integers , representing the start and end times of a contest.
Output Format
Output a single integer: the maximum number of contests he can attend.
3
0 2
2 4
1 3
2
Hint
- For of the testdata, .
- For of the testdata, .
- For of the testdata, .
- For of the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号