Language: C++

#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<LL,int> P;
const LL mod=1000000007;
const LL LINF=1LL<<62;
const LL INF=1<<17;
 
static const int MAX_SIZE = 1 << 20; 
 
typedef long long Int;
LL segMax[2 * MAX_SIZE - 1], segAdd[2 * MAX_SIZE - 1];
 
//区間[a, b)に値xを加算する.
void add(int a, int b, int x, int k = 0, int l = 0, int r = MAX_SIZE)
{
    if (r <= a || b <= l) return;
     
    if (a <= l && r <= b){
        segAdd[k] += x;
        return;
    }
     
    add(a, b, x, k * 2 + 1, l, (l + r) / 2);
    add(a, b, x, k * 2 + 2, (l + r) / 2, r);
 
    segMax[k] = max(segMax[k * 2 + 1] + segAdd[k * 2 + 1], segMax[k * 2 + 2] + segAdd[k * 2 + 2]);
}
 
LL getMax(int a, int b, int k = 0, int l = 0, int r = MAX_SIZE)
{
    if (r <= a || b <= l) return 0;
     
    if (a <= l && r <= b) return (segMax[k] + segAdd[k]);
     
    LL left = getMax(a, b, k * 2 + 1, l, (l + r) / 2);
    LL right = getMax(a, b, k * 2 + 2, (l + r) / 2, r);
     
    return (max(left, right) + segAdd[k]);
}
 
vector<P> v[200001];
 
int main(){
    int n,m;cin >> n >> m;
    for (int i = 0; i < m; i++) {
        int l,r,a;cin >> l >> r >> a;
        v[r].pb(make_pair(l,a));
    }
    for (int i = 0; i <= n; i++) {
        add(i,i+1,getMax(0,i));
        for (int j = 0; j < v[i].size(); j++) {
            add(v[i][j].fs,i+1,v[i][j].sc);
        }
    }
    cout << getMax(0,n+1) << endl;
    return 0;
}


Compiler output:
a.cc:15:1: error: extended character   is not valid in an identifier
   15 |  
      | ^
a.cc:17:1: error: extended character   is not valid in an identifier
   17 |  
      | ^
a.cc:20:1: error: extended character   is not valid in an identifier
   20 |  
      | ^
a.cc:24:1: error: extended character   is not valid in an identifier
   24 |     if (r <= a || b <= l) return;
      | ^
a.cc:24:1: error: extended character   is not valid in an identifier
a.cc:24:1: error: extended character   is not valid in an identifier
a.cc:24:1: error: extended character   is not valid in an identifier
a.cc:25:1: error: extended character   is not valid in an identifier
   25 |      
      | ^
a.cc:25:1: error: extended character   is not valid in an identifier
a.cc:25:1: error: extended character   is not valid in an identifier
a.cc:25:1: error: extended character   is not valid in an identifier
a.cc:25:1: error: extended character   is not valid in an identifier
a.cc:26:1: error: extended character   is not valid in an identifier
   26 |     if (a <= l && r <= b){
      | ^
a.cc:26:1: error: extended character   is not valid in an identifier
a.cc:26:1: error: extended character   is not valid in an identifier
a.cc:26:1: error: extended character   is not valid in an identifier
a.cc:27:1: error: extended character   is not valid in an identifier
   27 |         segAdd[k] += x;
      | ^
a.cc:27:1: error: extended character   is not valid in an identifier
a.cc:27:1: error: extended character   is not valid in an identifier
a.cc:27:1: error: extended character   is not valid in an identifier
a.cc:27:1: error: extended character   is not valid in an identifier
a.cc:27:1: error: extended character   is not valid in an identifier
a.cc:27:1: error: extended character   is not valid in an identifier
a.cc:27:1: error: extended character   is not valid in an identifier
a.cc:28:1: error: extended character   is not valid in an identifier
   28 |         return;
      | ^
a.cc:28:1: error: extended character   is not valid in an identifier
a.cc:28:1: error: extended character   is not valid in an identifier
a.cc:28:1: error: extended character   is not valid in an identifier
a.cc:28:1: error: extended character   is not valid in an identifier
a.cc:28:1: error: extended character   is not valid in an identifier
a.cc:28:1: error: extended character   is not valid in an identifier
a.cc:28:1: error: extended character   is not valid in an identifier
a.cc:29:1: error: extended character   is not valid in an identifier
   29 |     }
      | ^
a.cc:29:1: error: extended character   is not valid in an identifier
a.cc:29:1: error: extended character   is not valid in an identifier
a.cc:29:1: error: extended character   is not valid in an identifier
a.cc:30:1: error: extended character   is not valid in an identifier
   30 |      
      | ^
a.cc:30:1: error: extended character   is not valid in an identifier
a.cc:30:1: error: extended character   is not valid in an identifier
a.cc:30:1: error: extended character   is not valid in an identifier
a.cc:30:1: error: extended character   is not valid in an identifier
a.cc:31:1: error: extended character   is not valid in an identifier
   31 |     add(a, b, x, k * 2 + 1, l, (l + r) / 2);
      | ^
a.cc:31:1: error: extended character   is not valid in an identifier
a.cc:31:1: error: extended character   is not valid in an identifier
a.cc:31:1: error: extended character   is not valid in an identifier
a.cc:32:1: error: extended character   is not valid in an identifier
   32 |     add(a, b, x, k * 2 + 2, (l + r) / 2, r);
      | ^
a.cc:32:1: error: extended character   is not valid in an identifier
a.cc:32:1: error: extended character   is not valid in an identifier
a.cc:32:1: error: extended character   is not valid in an identifier
a.cc:33:1: error: extended character   is not valid in an identifier
   33 |  
      | ^
a.cc:34:1: error: extended character   is not valid in an identifier
   34 |     segMax[k] = max(segMax[k * 2 + 1] + segAdd[k * 2 + 1], segMax[k * 2 + 2] + segAdd[k * 2 + 2]);
      | ^
a.cc:34:1: error: extended character   is not valid in an identifier
a.cc:34:1: error: extended character   is not valid in an identifier
a.cc:34:1: error: extended character   is not valid in an identifier
a.cc:36:1: error: extended character   is not valid in an identifier
   36 |  
      | ^
a.cc:39:1: error: extended character   is not valid in an identifier
   39 |     if (r <= a || b <= l) return 0;
      | ^
a.cc:39:1: error: extended character   is not valid in an identifier
a.cc:39:1: error: extended character   is not valid in an identifier
a.cc:39:1: error: extended character   is not valid in an identifier
a.cc:40:1: error: extended character   is not valid in an identifier
   40 |      
      | ^
a.cc:40:1: error: extended character   is not valid in an identifier
a.cc:40:1: error: extended character   is not valid in an identifier
a.cc:40:1: error: extended character   is not valid in an identifier
a.cc:40:1: error: extended character   is not valid in an identifier
a.cc:41:1: error: extended character   is not valid in an identifier
   41 |     if (a <= l && r <= b) return (segMax[k] + segAdd[k]);
      | ^
a.cc:41:1: error: extended character   is not valid in an identifier
a.cc:41:1: error: extended character   is not valid in an identifier
a.cc:41:1: error: extended character   is not valid in an identifier
a.cc:42:1: error: extended character   is not valid in an identifier
   42 |      
      | ^
a.cc:42:1: error: extended character   is not valid in an identifier
a.cc:42:1: error: extended character   is not valid in an identifier
a.cc:42:1: error: extended character   is not valid in an identifier
a.cc:42:1: error: extended character   is not valid in an identifier
a.cc:43:1: error: extended character   is not valid in an identifier
   43 |     LL left = getMax(a, b, k * 2 + 1, l, (l + r) / 2);
      | ^
a.cc:43:1: error: extended character   is not valid in an identifier
a.cc:43:1: error: extended character   is not valid in an identifier
a.cc:43:1: error: extended character   is not valid in an identifier
a.cc:44:1: error: extended character   is not valid in an identifier
   44 |     LL right = getMax(a, b, k * 2 + 2, (l + r) / 2, r);
      | ^
a.cc:44:1: error: extended character   is not valid in an identifier
a.cc:44:1: error: extended character   is not valid in an identifier
a.cc:44:1: error: extended character   is not valid in an identifier
a.cc:45:1: error: extended character   is not valid in an identifier
   45 |      
      | ^
a.cc:45:1: error: extended character   is not valid in an identifier
a.cc:45:1: error: extended character   is not valid in an identifier
a.cc:45:1: error: extended character   is not valid in an identifier
a.cc:45:1: error: extended character   is not valid in an identifier
a.cc:46:1: error: extended character   is not valid in an identifier
   46 |     return (max(left, right) + segAdd[k]);
      | ^
a.cc:46:1: error: extended character   is not valid in an identifier
a.cc:46:1: error: extended character   is not valid in an identifier
a.cc:46:1: error: extended character   is not valid in an identifier
a.cc:48:1: error: extended character   is not valid in an identifier
   48 |  
      | ^
a.cc:50:1: error: extended character   is not valid in an identifier
   50 |  
      | ^
a.cc:64:1: error: extended character   is not valid in an identifier
   64 |     return 0;
      | ^
a.cc:64:1: error: extended character   is not valid in an identifier
a.cc:64:1: error: extended character   is not valid in an identifier
a.cc:64:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: '\U000000a0' does not name a type
   15 |  
      | ^
a.cc:17:1: error: '\U000000a0' does not name a type
   17 |  
      | ^
a.cc:19:15: error: 'MAX_SIZE' was not declared in this scope
   19 | LL segMax[2 * MAX_SIZE - 1], segAdd[2 * MAX_SIZE - 1];
      |               ^~~~~~~~
a.cc:19:41: error: 'MAX_SIZE' was not declared in this scope
   19 | LL segMax[2 * MAX_SIZE - 1], segAdd[2 * MAX_SIZE - 1];
      |                                         ^~~~~~~~
a.cc:20:1: error: '\U000000a0' does not name a type
   20 |  
      | ^
a.cc:36:1: error: '\U000000a0' does not name a type
   36 |  
      | ^
a.cc:48:1: error: '\U000000a0' does not name a type
   48 |  
      | ^
a.cc:50:1: error: '\U000000a0' does not name a type
   50 |  
      | ^