| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 512 MB | 341 | 180 | 156 | 55.516% |
You have an array $a$ with $n$ integers. There are three types of operations:
Your goal is to process the operations and print the answers of all type 3 operations.
The first line of the input contains two integers $n$ and $q$ (1ドル \le n, q \le 10^5$). The second line contains $n$ integers $a_1, \ldots, a_n$. Then $q$ lines follow, each line describes an operation.
It is guaranteed that 1ドル \le a_i, x \le 10^5,ドル 1ドル \le l \le r \le n$.
For each operation of type 3, print a single line containing the required sum.
5 5 1 2 3 4 5 1 3 5 2 2 1 4 3 2 4 2 3 5 3 1 5
5 6