n,q=list(map(int, input().split()))

*a,=list(map(int, input().split()))

bit=[0]*(2*n+1)



def add(t,x):

    while t<=n:

        bit[t]+=x

        t+=t&(-t)



def que(t):

    res=0

    while t:

        res+=bit[t]

        t-=t&(-t)

    return res



for i in range(n):

    add(i+1,a[i])





for _ in range(q):

    i,p,x=list(map(int, input().split()))

    if i:

        ans=que(x)-que(p)

        print(ans)

    else:

        add(p+1,x)

import sys

input=sys.stdin.readline

n,q=list(map(int, input().split()))

*a,=list(map(int, input().split()))

bit=[0]*(n+1)



def add(t,x):

    while t<=n:

        bit[t]+=x

        t+=t&(-t)



def que(t):

    res=0

    while t:

        res+=bit[t]

        t-=t&(-t)

    return res



for i in range(n):

    add(i+1,a[i])





for _ in range(q):

    i,p,x=list(map(int, input().split()))

    if i:

        ans=que(x)-que(p)

        print(ans)

    else:

        add(p+1,x)

n, q = list(map(int, input().split()))
(*a,) = list(map(int, input().split()))
bit = [0] * (2 * n + 1)


def add(t, x):
    while t <= n:
        bit[t] += x
        t += t & (-t)


def que(t):
    res = 0
    while t:
        res += bit[t]
        t -= t & (-t)
    return res


for i in range(n):
    add(i + 1, a[i])
for _ in range(q):
    i, p, x = list(map(int, input().split()))
    if i:
        ans = que(x) - que(p)
        print(ans)
    else:
        add(p + 1, x)

import sys

input = sys.stdin.readline
n, q = list(map(int, input().split()))
(*a,) = list(map(int, input().split()))
bit = [0] * (n + 1)


def add(t, x):
    while t <= n:
        bit[t] += x
        t += t & (-t)


def que(t):
    res = 0
    while t:
        res += bit[t]
        t -= t & (-t)
    return res


for i in range(n):
    add(i + 1, a[i])
for _ in range(q):
    i, p, x = list(map(int, input().split()))
    if i:
        ans = que(x) - que(p)
        print(ans)
    else:
        add(p + 1, x)

+import sys + +input = sys.stdin.readline -bit = [0] * (2 * n + 1) +bit = [0] * (n + 1)