| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 0.7 초 | 1024 MB | 1 | 0 | 0 | 0.000% |
Due to unforeseen circumstances this task is not fifth.
A recent survey by polling agency "Ko & co" found that no one likes the numbers from $1$ to $4$. So we will focus on the next number, $5$, and hope it does not follow the unfortunate fate of its predecessors.
Consider the following sequence in the positive and negative indices:
Note that equality uniquely defines both the positive and the negative indices (e.g. $x_5 = 40$, $x_6 = 230$, $\dots$ and $x_{-1} = -22$, $x_{-2} = 33$, $\dots$)
You are given an array of $n$ numbers $a_1, a_2 , \dots, a_n$. Write a program five that supports $2$ types of events:
The first line of the standard input contains the numbers $n$ and $q$. The next line contains $n$ integers $a_1, a_2 ,\dots , a_n$. Each of the following $q$ lines contains $3$ natural numbers $type$, $l$, $r$.
For each Query, print on a new line the answer for that query.
| 번호 | 배점 | 제한 |
|---|---|---|
| 1 | 5 | $0 ≤ a_i ≤ 10^6$ and only Query |
| 2 | 19 | $0 ≤ a_i, value$ and $l = r$ |
| 3 | 19 | $0 ≤ a_i, value$ and $q ≤ 20\,000$ |
| 4 | 19 | $q ≤ 20\,000$ |
| 5 | 19 | $q ≤ 100\,000$ |
| 6 | 19 | None |
1 5 1 1 1 1 2 1 1 -2 1 1 1 2 1 1 8 1 1 1
1 100000521 1330
At the start $a_1 = 1$ and $x_{a_1} = 1$. After the first Update $a_1 = -1$ and $x_{a_1} = -22$. After the second Update $a_1 = 7$ and $x_{a_1} = 1330$.