#P5511. 决战
决战
Description
However, the dark forces can change the terrain, which makes it very difficult for the army to advance.
To help the army move faster, Steve brought nuclear weapons to the front line to destroy the terrain.
Also, Steve cares a lot about the current terrain situation.
Specifically, the front-line terrain can be divided into segments, with initial height . During the final battle, events will happen. An event can be:
- Steve asks: in the interval , how many segments have height less than the given height .
- Steve uses nuclear weapons: in the interval , for segments whose height is greater than , reduce their height to .
- The dark forces change the terrain: in the interval , for segments whose height is less than , increase their height to .
Because the battle is very urgent, some test points require online processing.
For test points with , let the answer to the last type 1 event be . You need to XOR , , and with respectively to get the actual values. If no type 1 event has been answered yet, then .
Input Format
The first line contains integers .
The next lines each contain integers describing an event.
The first integer indicates the event type, followed by integers , with meanings as described above.
There are cases where in the testdata. In this case, please ignore this operation directly.
Output Format
For each type 1 event, output one integer per line, which is the answer to the query.
10 8 0
1 1 5 1
3 1 3 5
1 1 5 3
2 2 3 3
1 1 5 3
1 1 5 5
3 3 4 2
1 1 5 3
5
2
2
4
2
Hint
Sample explanation:
[00000]00000=>5[TTTTT]
[000]0000000
[55500]00000=>2[FFFTT]
5[55]0000000
[53300]00000=>2[FFFTT]
[53300]00000=>4[FTTTT]
53[30]000000
[53320]00000=>2[FFFTT]
Constraints:
For all data, it is guaranteed that .
Subtask 1 is the data used during the contest.
| Test point | Score | Special property | ||
|---|---|---|---|---|
| 1 | 4 | 1000 | ||
| 2 | 14 | 100000 | ||
| 3 | 11 | |||
| 4 | 10 | 1000 | ||
| 5 | 12 | 100000 | ||
| 6 | 14 | * | ||
| 7 | 16 | |||
| 8 | 19 | |||
For test point 6, it is guaranteed that all type 1 events occur after type 2 and type 3 events.
Subtask 2 is unscored hack data. It currently only contains one dataset, satisfying the property of #8.
$\color{white}\texttt{No guarantee that the data is random}$
Translated by ChatGPT 5
京公网安备 11011102002149号