Tên đăng nhập Điểm Bài tập ▾ Giới thiệu
13401 457 5
13401 457 5
13401 457 5
13401 457 5
13401 457 5
13401 457 5
13407
ngtvu278 1014
Nguyễn Tiến Vũ
3797 5
13408
VuHau 1642
Vũ Văn Hậu
2513 5
13409
114tinminhnguyenduc 1097
Nguyễn Đức Minh
2134 5
13410
humanoidLamp 1379
Trần Công Minh
3127 5
13411 2070 5
13412 1676 5
13413 3488 5
13414
nguyenhaiyen30485
Nguyễn Thị Yến
812 5
13415
ti21_lchung
Lê Chí Hưng
2351 5
13416
tk21thanhnh
Nguyễn Hải Thành
457 5
13417 2356 5
13418
cbtn 1102
1007 5
13419 2326 5
13420 4216 5
13421 457 5
13421 457 5
13423 3867 5
13424 2500 5
13425 457 5
13425 457 5
13425 457 5
13428 504 5
13429 1804 5
13430 1433 5
13431 467 5
13432 1157 5
13433 3273 5
13434 2534 5
13435 569 5
13436 1186 5
13437 2209 5
13438 6298 5
13439 1522 5
13440 993 5
13441 383 5
13442 1084 5
13443 1070 5
13444 457 5
13445 526 5
13446 650 5
13447 2386 5
13448 674 5
13449 974 5
13450
Terrobyte 1825
Hồ Sỹ Phát, Nghệ An
267 5

Cười Khúc Khích

13451 3322 5
13452 470 5
13453 3813 5
13454 2328 5
13455 649 5
13456 1075 5

hihi

13457 524 5
13458
ok 851
1406 5
13459 457 5
13460
casiofx580
__Khanh__
3906 5
13461 1675 5

sd

13462 657 5
13463 4873 5
13464 457 5
13465
anhqlee225
Le Ngoc Quynh Anh
1315 5
13466 3188 5
13467 1462 5
13468 5356 5
13469 2495 5
13470 3688 5
13471 2245 5
13472 532 5

13473 402 5
13474 513 5

Github: luc11zm3

Discord: luc11zm3#2603

13475 2662 5
13476 2649 5

the hlongze

13477 966 5
13478 2012 5
13479
VietAnhCNH 1529
Trương Hữu Việt Anh
3028 5
13480 1157 5
13481 675 5
13482 2108 5
13483 557 5
13484 1672 5
13485 457 5
13485 457 5
13487
cbl_thuydung 947
Hồ Thị Thuỳ Dung, B.Phước
1379 5
13488 1387 5
13489 2590 5

include <bits/stdc++.h>

define forr(i,l,r) for (int i=l;i<=r;i++)

define ford(i,r,l) for (int i=r;i>=l;i--)

define yes cout <<"YES\n"

define no cout <<"NO\n"

define fi first

define se second

define ull unsigned long long

define ll long long

define sz(s) s.size()

define el "\n"

define faster ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

using namespace std;
int a[100005];
int n;
void update(int i, int val){
while(i <= n ){
a[i]+= val;
i += (i&-i);
}
}
int get(int i){
int sum = 0;
while(i){
sum+=a[i];
i-=(i&-i);
}
return sum;
}
void solve(){
int q,x,u,v,t;
cin >> n;
cin >> q;

forr(i,1,n) {
    cin >> x;
    update(i,x);
}
while(q--){
        cin >> t >> u >> v;
        if(t == 1) update(u,v);
        else {
            if(u == 1) cout << get(v) << endl;
            else cout << get(v)-get(u-1)<<endl;
        }


}

}
signed main()
{ faster;
int t=1;
///cin >> t;
while(t--) solve();

return 0;

}

13490
tp5520138
Đinh Chí Thành, Thành phố Hồ Chí Minh
849 5
13491 407 5
13492 1157 5
13493 1485 5
13494 2553 5
13495 2639 5
13496 1229 5
13497 1157 5
13498 973 5
13499 2507 5
13500 4589 5