| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 10 초 | 2048 MB | 0 | 0 | 0 | 0.000% |
You are given a permutation $a_1, \ldots, a_n$. You need to maintain a sequence $b_1, \ldots, b_n$ initialized by zeroes. Process $m$ operations of the following form:
The first line of input contains two integers $n$ and $m$ (1ドル \leq n, m \leq 2 \cdot 10^5$).
The second line contains $n$ integers $a_1, \ldots, a_n$ (1ドル \leq a_i \leq n$; all $a_i$ are distinct).
Each of the next $m$ lines consists of integers and has either the form "1~$\ell$~$r$" for a modification operation or the form "2~$x$" for a query operation (1ドル \leq \ell \leq r \leq n$; 1ドル \leq x \leq n$).
You may assume that the input contains at least one query operation.
For each query operation, output one line containing an integer that represents the answer.
8 10 5 4 8 7 1 6 3 2 1 2 5 2 8 1 2 8 1 7 8 2 4 2 1 2 6 2 4 1 8 8 2 4
0 4 0 3 4 4