#ds101. 树状数组1
树状数组1
Fenwick Tree 1
Problem Description
You are given numbers .
Support operations:
1 x d: set .2 x: query .
Input Format
The first line contains two integers ().
The next line contains integers ().
The next lines each contain an operation of the form 1 x d or 2 x, with and guaranteed.
Output Format
For each query, output one line containing the answer.
Sample Input
5 5
1 2 3 4 5
2 4
1 1 5
2 5
1 2 3
2 3
Sample Output
10
19
11