#P1496. 火烧赤壁
火烧赤壁
Description
Given the start and end of each burning segment, please compute the total length of the burning positions.
Input Format
The first line contains an integer , indicating the number of fire reports.
Then follow lines; each line contains two integers , denoting the start and end of a burning segment (Note: left-closed, right-open).
Output Format
Output a single line with one integer representing the answer.
3
-1 1
5 11
2 9
11
Hint
Constraints
For all test points, it is guaranteed that , , and the answer is less than .
Translated by ChatGPT 5
京公网安备 11011102002149号