#P11210. 『STA - R8』强制在线动态二维数点
『STA - R8』强制在线动态二维数点
Background
The latest achievement in the data structure world. Forced online dynamic 2D point counting can already be done in linear time!
Problem Description
To win the Turing Award, you need to solve the following dynamic online 2D point counting problem.
There are points on the plane, arranged below the line (that is, holds).
I will perform operations. There are two types of operations:
- Update operation
U i x y: set . (That is, assign and to and respectively.) - Query operation
Q l r: given a rectangle whose four vertices are , find the minimum value of among all points inside the given rectangle. In particular, if the rectangle contains no points, the answer is defined as .
The two types of operations will be encrypted in some way. See the detailed requirements in the [Input Format] section below.
: A point is inside the rectangle formed by if and only if and .
Input Format
The first line contains two integers and .
The next lines each contain two integers and , describing the coordinates of each point.
The following lines give the type of each operation and the encrypted values of its parameters. The true decrypted values of must all be XORed with your previous output answer (do not XOR before the first query operation). It is guaranteed that after decryption, the constraints and , hold.
Output Format
For each query operation, output one line containing your answer.
5 6
4 1
4 1
4 2
4 1
5 2
Q 2 5
U 6 6 3
Q 3 7
Q 1 6
U 2 4 2
Q 2 3
2
2
0
0
Hint
For all testdata, , and it is guaranteed that after decryption, and , .
This problem uses bundled tests and enables subtask dependencies.
- Subtask 0 (5 points): .
- Subtask 1 (20 points): no update operations.
- Subtask 2 (25 points): satisfies special properties.
- Subtask 3 (20 points): .
- Subtask 4 (30 points): no special restrictions.
Special properties (random data): the operation types, update positions, point coordinates (initial and after updates), and query ranges (the values of parameters ) are generated independently and uniformly at random within the valid ranges.
Translated by ChatGPT 5