#P5568. [SDOI2008] 校门外的区间
[SDOI2008] 校门外的区间
Description
Inspired by the classic problem “Trees Outside the School Gate”, person A, based on basic knowledge of discrete mathematics, abstracts kinds of operations to maintain a set ( is initially empty) and finally output . Now, please complete this harder enhanced version of “Trees Outside the School Gate” — “Intervals Outside the School Gate”.
The five operations are:
U T:I T:D T:C T:S T:
The basic set operations are defined as follows:
- :
- :
- :
- : .
Input Format
There are lines. The first letter of each line describes the operation type, followed by an interval (an interval is written as (a,b), (a,b], [a,b), [a,b]).
Output Format
Output one line containing several intervals representing the set . All intervals should be output in increasing order, and there should be exactly one space between two adjacent intervals.
If the set is empty, output empty set.
U [1,5]
D [3,3]
S [2,4]
C (1,5)
I (2,3]
(2,3)
Hint
.
Translated by ChatGPT 5
京公网安备 11011102002149号