#P2519. [HAOI2011] problem a
[HAOI2011] problem a
Description
An exam has participants, and multiple people may have the same score. The -th person says: "There are people who scored higher than me, and people who scored lower than me."
Find the minimum number of people who did not tell the truth.
Input Format
The first line contains an integer , the number of participants.
Lines to each contain two space-separated integers. On the -th line, the two integers represent the number of people scoring higher than the -th person and the number of people scoring lower than the -th person .
Output Format
Output a single integer, the minimum number of people who did not tell the truth.
3
2 0
0 2
2 2
1
Hint
For of the testdata, it is guaranteed that , .
Translated by ChatGPT 5
京公网安备 11011102002149号