#P7391. 「TOCO Round 1」自适应 PVZ
「TOCO Round 1」自适应 PVZ
Description
The unlucky encountered zombies on the lawn. Zombie appears at time and will enter the house at time .
has Peashooters. If a Peashooter keeps attacking zombie continuously during the time interval from to (excluding both endpoints), then it can kill zombie . However, during the attack it cannot attack any other zombie, and the target zombie cannot be changed.
Now wants to know: with a proper schedule, what is the minimum number of zombies that will enter his house.
Input Format
The first line contains two integers , representing the number of zombies and the number of Peashooters.
The next lines each contain two integers and , representing the time when zombie appears and the time when it enters the house.
Output Format
Output one integer representing the answer.
2 1
1 2
3 4
0
3 2
1 3
1 3
2 4
1
2 1
1 3
3 5
0
Hint
For of the testdata, .
For of the testdata, .
For another of the testdata, .
For of the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号