本站作为LDUOnlineJudge的测试版本进行演示,官方网站请访问http://icpc.ldu.edu.cn
[Hidden]

1150. 区间修改,区间查询


Description

Input

Output

对于每个 2 l r 操作,输出一行,每行有一个整数,表示所求的结果。

Samples

Input Copy
5 10
2 6 6 1 1
2 1 4
1 2 5 10
2 1 3
2 2 3
1 2 2 8
1 2 3 7
1 4 4 10
2 1 2
1 4 5 6
2 3 4
Output
15
34
32
33
50

Hint

对于所有数据,1<=n,q<=106,|a[i]|<=106 ,1<=l<=r<=n,|x[i]|<=106  。

Source

树状数组 loj132
Problem Information

Time Limit: 2000MS (C/C++,Others×2)
Memory Limit: 256MB (C/C++,Others×2)
Special Judge: No
AC/Submit: 5 / 10
Tags:
Contests involved

1018. 树状数组--loj.ac
My history solutions

You didn't submit any solution!
Submit your solution

Login Register