#P8582. [CoE R5] 斑马王子
[CoE R5] 斑马王子
Background
Note: In Subtask #4 of this problem, can be treated as . The testdata will be fixed later, and another notice will be given after the fix.
UPD: Fixed.
Problem Description
Brief statement
There is an array of length , indexed from to . Initially, .
Next, you are given pairs of non-negative integers . Let . Set all with to .
At any moment, define $S =\{ x \mid x \in \mathbb{Z} \wedge x \in [0,\ k] \wedge s_x = 0 \}$. Then you are given triples of non-negative integers .
- When , compute:
-
When , set all with to .
-
When , set all with to .
Here, denotes the set of all integers, and denotes XOR.
Original story statement
The “Zebra Prince” rules over the boundless grassland.
A small river flows quietly through the center of the grassland. A piece of grassland at distance from the river source is given “membrane power” (mo li, 膜力) of value .
On day , the Zebra Prince’s “potential IQ” is .
He will go to a grassland he likes to dine, and start a new day with “IQ” equal to .
There is a kind of creature called “hunters”, who love to take away the lives of grassland residents.
Initially, they set up camps of the form $(l_i,\ r_i) \ (0 \leqslant l_i \leqslant r_i \leqslant k)$, and use “guns” to kill all living beings that stop within .
As the Zebra Prince’s capable minister, you need to answer some of his questions to keep the grassland safe.
On this ever-changing grassland, events of the form $(opt_i,\ a_i,\ b_i) \ (0 \leqslant a_i \leqslant b_i \leqslant k , \ opt_i \in \{0,\ 1,\ 2\})$ will happen in order.
When , event means the hunters have set up new camps everywhere in .
When , event means the Zebra Prince’s brave army has destroyed all camps in .
When , the Zebra Prince asks you a soul-searching question:
In each query, from day to day , the Zebra Prince wants to dine on grasslands that are not “hunter” camps. He wants to know the minimum possible value of the sum of “IQ” from day to day .
You rack your brain. Suddenly, the roar of “guns” tears the air apart. If you cannot answer within …
Input Format
The first line contains integers .
The next lines each contain two integers , describing one hunter camp.
The next lines each contain three integers , describing one operation.
Output Format
For the -th operation :
- If or , you do not need to output anything.
- If , then if all grasslands belong to hunter camps, output one line
Death. Otherwise, output one line with an integer, representing .
0 16 3
0 0 3
1 3 3
0 0 3
1 1 2
0 0 3
2 1 3
0 0 3
1 0 0
1 1 1
0 0 3
0 1 2
0 1 3
1 2 3
0 2 3
2 3 3
0 2 3
0
1
6
0
4
2
2
Death
1
Hint
Constraints
This problem uses bundled tests.
: For of the data, .
: For of the data, .
: For of the data, .
: For of the data, .
: No special restrictions.
For of the data: , , , and .
Translated by ChatGPT 5