시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
12 초 | 1024 MB | 22 | 12 | 9 | 69.231% |
There is an cell grid infinite in left, right, and upwards directions (all the cells with coordinates $(x, y)$ with $x \in \mathbb{Z}$, $y \ge 0$ exist). Initially all the cells are white. You have to process $q$ queries of two types:
To enforce processing the queries online they are encrypted using previous answers.
The first line contains one integer $q$ ($1 \le q \le 10^{5}$) --- the number of queries to process.
The next $q$ lines will contain encrypted descriptions of queries. Let $S$ be the sum of answers to all queries of second type processed so far.
Each description has form either $1$ $(y_{i} \oplus S)$ $(l_{i} \oplus S)$ $(r_{i} \oplus S)$ or $2$ $(l_{i} \oplus S)$ $(r_{i} \oplus S)$. It is guaranteed that $0 \le y_{i} \le 2 \cdot 10^{5}$, $0 \le l_{i} \le r_{i} \le 2 \cdot 10^{5}$. Note that the guarantees are given on parameters after decryption, the numbers in input might not fit in 32-bit integers.
Don't forget to add the new answer to $S$ after each query of the second type.
Print the answers to all queries of the second type on separate lines.
10 1 0 1 1 2 0 10 1 1 9 9 1 0 0 6 1 0 3 9 2 5 5 1 1 5 5 2 5 5 2 0 5 1 7 6 3
1 0 2 2
S | Encrypted | Query | Ans |
---|---|---|---|
0 | 1 0 1 1 | 1 0 1 1 | - |
0 | 2 0 10 | 2 0 10 | 1 |
1 | 1 1 9 9 | 1 0 8 8 | - |
1 | 1 0 0 6 | 1 1 1 7 | - |
1 | 1 0 3 9 | 1 1 2 8 | - |
1 | 2 5 5 | 2 4 4 | 0 |
1 | 1 1 5 5 | 1 0 4 4 | - |
1 | 2 5 5 | 2 4 4 | 2 |
3 | 2 0 5 | 2 3 6 | 2 |
5 | 1 7 6 3 | 1 2 3 6 | - |