Language: C++

ll n, q, s, t;

struct RSQ
{
	ll gt;
	ll a[N_SIZE];
	ll seg[N_SIZE * 2];
	void init(int n) {
		gt = 1;
		while (gt < n)gt *= 2;
		rep(i, n)a[i] = 0;
		rep(i, N_SIZE * 2)seg[i] = 0;
		rep(i, n)seg[i + gt] = a[i];
	}
	void update(int k, int x) {
		k += gt - 1;
		seg[k] += x;
		while (k) {
			k = (k - 1) / 2;//???????????????
			seg[k] += x;
		}
	}
	ll query(int a, int b) {
		return query(a, b, 0, 0, gt);
	}
	ll query(int a, int b, int k, int l, int r) {//[a,b)???????????????,k=0,l=0,r=gt
		if (r <= a || b <= l)return 0;

		if (a <= l&&r <= b)return seg[k];
		else return query(a, b, k * 2 + 1, l, (l + r) / 2)
			+ query(a, b, k * 2 + 2, (l + r) / 2, r);
	}
	void print() {
		rep(i, 2 * gt)cout << "!" << i << " " << seg[i] << endl;
	}
};

RSQ rsq;

int main() {
	cin >> n >> q;
	rsq.init(n + 1);
	rep(i, q) {
		int a, b, c;
		cin >> a >> b >> c;
		b--;
		if (a == 0) {
			rsq.update(b, c);
		}
		else {
			cout << rsq.query(b, c) << endl;
		}
	}
}

Compiler output:
a.cc:1:1: error: 'll' does not name a type
    1 | ll n, q, s, t;
      | ^~
a.cc:5:9: error: 'll' does not name a type
    5 |         ll gt;
      |         ^~
a.cc:6:9: error: 'll' does not name a type
    6 |         ll a[N_SIZE];
      |         ^~
a.cc:7:9: error: 'll' does not name a type
    7 |         ll seg[N_SIZE * 2];
      |         ^~
a.cc:23:9: error: 'll' does not name a type
   23 |         ll query(int a, int b) {
      |         ^~
a.cc:26:9: error: 'll' does not name a type
   26 |         ll query(int a, int b, int k, int l, int r) {//[a,b)???????????????,k=0,l=0,r=gt
      |         ^~
a.cc: In member function 'void RSQ::init(int)':
a.cc:9:17: error: 'gt' was not declared in this scope
    9 |                 gt = 1;
      |                 ^~
a.cc:11:21: error: 'i' was not declared in this scope
   11 |                 rep(i, n)a[i] = 0;
      |                     ^
a.cc:11:17: error: 'rep' was not declared in this scope
   11 |                 rep(i, n)a[i] = 0;
      |                 ^~~
a.cc:12:24: error: 'N_SIZE' was not declared in this scope
   12 |                 rep(i, N_SIZE * 2)seg[i] = 0;
      |                        ^~~~~~
a.cc: In member function 'void RSQ::update(int, int)':
a.cc:16:22: error: 'gt' was not declared in this scope
   16 |                 k += gt - 1;
      |                      ^~
a.cc:17:17: error: 'seg' was not declared in this scope
   17 |                 seg[k] += x;
      |                 ^~~
a.cc: In member function 'void RSQ::print()':
a.cc:34:21: error: 'i' was not declared in this scope
   34 |                 rep(i, 2 * gt)cout << "!" << i << " " << seg[i] << endl;
      |                     ^
a.cc:34:28: error: 'gt' was not declared in this scope
   34 |                 rep(i, 2 * gt)cout << "!" << i << " " << seg[i] << endl;
      |                            ^~
a.cc:34:17: error: 'rep' was not declared in this scope
   34 |                 rep(i, 2 * gt)cout << "!" << i << " " << seg[i] << endl;
      |                 ^~~
a.cc: In function 'int main()':
a.cc:41:9: error: 'cin' was not declared in this scope
   41 |         cin >> n >> q;
      |         ^~~
a.cc:41:16: error: 'n' was not declared in this scope
   41 |         cin >> n >> q;
      |                ^
a.cc:41:21: error: 'q' was not declared in this scope
   41 |         cin >> n >> q;
      |                     ^
a.cc:43:13: error: 'i' was not declared in this scope
   43 |         rep(i, q) {
      |             ^
a.cc:43:9: error: 'rep' was not declared in this scope
   43 |         rep(i, q) {
      |         ^~~