This documentation is automatically generated by online-judge-tools/verification-helper
#define PROBLEM "http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_2_B"
#include <iostream>
#include "../../atcoder/segtree/add.hpp"
using namespace std;
// @title セグメント木、sum (ac-library)
using ll = long long;
int main() {
int n, q; cin >> n >> q;
segtree::add::type<ll> seg(n);
for (int i = 0; i < q; ++i) {
int c, x, y; cin >> c >> x >> y; --x;
if (c == 0) seg.set(x, seg.get(x) + y);
else cout << seg.prod(x, y) << endl;
}
}
#line 1 "test/ac-library/segtree.sum.test.cpp"
#define PROBLEM "http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_2_B"
#include <iostream>
#line 2 "atcoder/segtree/add.hpp"
#include <atcoder/segtree>
#include <limits>
namespace segtree {
namespace add {
template<typename S>
S op(S a, S b) { return a+b; }
template<typename S>
S e() { return 0;}
template<typename S>
using type = atcoder::segtree<S, op, e>;
} // namespace add
} // namespace segtree
#line 5 "test/ac-library/segtree.sum.test.cpp"
using namespace std;
// @title セグメント木、sum (ac-library)
using ll = long long;
int main() {
int n, q; cin >> n >> q;
segtree::add::type<ll> seg(n);
for (int i = 0; i < q; ++i) {
int c, x, y; cin >> c >> x >> y; --x;
if (c == 0) seg.set(x, seg.get(x) + y);
else cout << seg.prod(x, y) << endl;
}
}