#P11853. [CSP-J 2022 山东] 植树节
[CSP-J 2022 山东] 植树节
Background
Due to the pandemic, Shandong Province canceled the CSP-J 2022 certification event and set a new problem in March of the following year, holding a make-up contest within the province.
Problem Description
Arbor Day is coming soon, and the school is going to organize volunteers to water young trees.
There is a row of young trees, numbered in order.
Now there are volunteers to water the trees. The -th volunteer chooses an interval , meaning that the -th volunteer will water every tree in the interval once.
For example, if a volunteer chooses the watering interval , it means they will water each tree numbered once.
After all volunteers finish watering their chosen intervals, some trees may have been watered multiple times by different volunteers, and some trees may not have been watered at all.
Please find the maximum number of times any single tree has been watered.
Input Format
Line contains one integer , the number of volunteers.
Lines to each contain two integers (), representing the interval chosen by volunteer .
Output Format
Output line containing integer, the number of times the most-watered tree has been watered.
4
0 2
2 4
1 4
6 7
3
4
1000000 1000000
1000000 1000000
0 1000000
1 1000000
4
Hint
Constraints
- For all testdata: ; 。
::cute-table{tuack}
| Test Point ID | Special Property | |||
|---|---|---|---|---|
| None | ||||
| None | ||||
Translated by ChatGPT 5