Language: C++

#include<algorithm>
#include<cstdio>
#include<cstring>
  
const int Maxv = 100010; 
int l[Maxv << 1], r[Maxv << 1], n; 
long long ans; 
  
inline int read(){
    int x = 0, f = 1; 
    char ch = getchar(); 
    while (ch < '0' || ch > '9') {
        if (ch == '-') {
            f = -1; 
        }
        ch = getchar(); 
    }
    while (ch >= '0' && ch <= '9') {
        x = (x << 3) + (x << 1) + ch - '0'; 
        ch = getchar(); 
    }
    return x * f; 
}
  
int main(){
    n = read(); 
    for (int i = 1; i <= n; i++) {
        int L = read(); 
        int R = read(); 
        l[Maxv + R]++; 
        r[Maxv + L]++; 
    }
    l[Maxv]++; 
    r[Maxv]++; 
    for (int i = 1; i < 2 * Maxv; i++) {
        l[i] += l[i - 1]; 
    }
    for (int i = 2 * Maxv - 2; i >= 0; i--) {
        r[i] += r[i + 1]; 
    }
    for (int i = 0; i < 2 * Maxv - 1; i++) {
        ans += std::min(l[i], r[i + 1]) * 2; 
    }
    printf("%lld\n", ans); 
    return 0; 
}

Compiler output:
a.cc:4:1: error: extended character   is not valid in an identifier
    4 |   
      | ^
a.cc:4:1: error: extended character   is not valid in an identifier
a.cc:8:1: error: extended character   is not valid in an identifier
    8 |   
      | ^
a.cc:8:1: error: extended character   is not valid in an identifier
a.cc:10:1: error: extended character   is not valid in an identifier
   10 |     int x = 0, f = 1;
      | ^
a.cc:10:1: error: extended character   is not valid in an identifier
a.cc:10:1: error: extended character   is not valid in an identifier
a.cc:10:1: error: extended character   is not valid in an identifier
a.cc:11:1: error: extended character   is not valid in an identifier
   11 |     char ch = getchar();
      | ^
a.cc:11:1: error: extended character   is not valid in an identifier
a.cc:11:1: error: extended character   is not valid in an identifier
a.cc:11:1: error: extended character   is not valid in an identifier
a.cc:12:1: error: extended character   is not valid in an identifier
   12 |     while (ch < '0' || ch > '9') {
      | ^
a.cc:12:1: error: extended character   is not valid in an identifier
a.cc:12:1: error: extended character   is not valid in an identifier
a.cc:12:1: error: extended character   is not valid in an identifier
a.cc:13:1: error: extended character   is not valid in an identifier
   13 |         if (ch == '-') {
      | ^
a.cc:13:1: error: extended character   is not valid in an identifier
a.cc:13:1: error: extended character   is not valid in an identifier
a.cc:13:1: error: extended character   is not valid in an identifier
a.cc:13:1: error: extended character   is not valid in an identifier
a.cc:13:1: error: extended character   is not valid in an identifier
a.cc:13:1: error: extended character   is not valid in an identifier
a.cc:13:1: error: extended character   is not valid in an identifier
a.cc:14:1: error: extended character   is not valid in an identifier
   14 |             f = -1;
      | ^
a.cc:14:1: error: extended character   is not valid in an identifier
a.cc:14:1: error: extended character   is not valid in an identifier
a.cc:14:1: error: extended character   is not valid in an identifier
a.cc:14:1: error: extended character   is not valid in an identifier
a.cc:14:1: error: extended character   is not valid in an identifier
a.cc:14:1: error: extended character   is not valid in an identifier
a.cc:14:1: error: extended character   is not valid in an identifier
a.cc:14:1: error: extended character   is not valid in an identifier
a.cc:14:1: error: extended character   is not valid in an identifier
a.cc:14:1: error: extended character   is not valid in an identifier
a.cc:14:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
   15 |         }
      | ^
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc:15:1: error: extended character   is not valid in an identifier
a.cc:16:1: error: extended character   is not valid in an identifier
   16 |         ch = getchar();
      | ^
a.cc:16:1: error: extended character   is not valid in an identifier
a.cc:16:1: error: extended character   is not valid in an identifier
a.cc:16:1: error: extended character   is not valid in an identifier
a.cc:16:1: error: extended character   is not valid in an identifier
a.cc:16:1: error: extended character   is not valid in an identifier
a.cc:16:1: error: extended character   is not valid in an identifier
a.cc:16:1: error: extended character   is not valid in an identifier
a.cc:17:1: error: extended character   is not valid in an identifier
   17 |     }
      | ^
a.cc:17:1: error: extended character   is not valid in an identifier
a.cc:17:1: error: extended character   is not valid in an identifier
a.cc:17:1: error: extended character   is not valid in an identifier
a.cc:18:1: error: extended character   is not valid in an identifier
   18 |     while (ch >= '0' && ch <= '9') {
      | ^
a.cc:18:1: error: extended character   is not valid in an identifier
a.cc:18:1: error: extended character   is not valid in an identifier
a.cc:18:1: error: extended character   is not valid in an identifier
a.cc:19:1: error: extended character   is not valid in an identifier
   19 |         x = (x << 3) + (x << 1) + ch - '0';
      | ^
a.cc:19:1: error: extended character   is not valid in an identifier
a.cc:19:1: error: extended character   is not valid in an identifier
a.cc:19:1: error: extended character   is not valid in an identifier
a.cc:19:1: error: extended character   is not valid in an identifier
a.cc:19:1: error: extended character   is not valid in an identifier
a.cc:19:1: error: extended character   is not valid in an identifier
a.cc:19:1: error: extended character   is not valid in an identifier
a.cc:20:1: error: extended character   is not valid in an identifier
   20 |         ch = getchar();
      | ^
a.cc:20:1: error: extended character   is not valid in an identifier
a.cc:20:1: error: extended character   is not valid in an identifier
a.cc:20:1: error: extended character   is not valid in an identifier
a.cc:20:1: error: extended character   is not valid in an identifier
a.cc:20:1: error: extended character   is not valid in an identifier
a.cc:20:1: error: extended character   is not valid in an identifier
a.cc:20:1: error: extended character   is not valid in an identifier
a.cc:21:1: error: extended character   is not valid in an identifier
   21 |     }
      | ^
a.cc:21:1: error: extended character   is not valid in an identifier
a.cc:21:1: error: extended character   is not valid in an identifier
a.cc:21:1: error: extended character   is not valid in an identifier
a.cc:22:1: error: extended character   is not valid in an identifier
   22 |     return x * f;
      | ^
a.cc:22:1: error: extended character   is not valid in an identifier
a.cc:22:1: error: extended character   is not valid in an identifier
a.cc:22:1: error: extended character   is not valid in an identifier
a.cc:24:1: error: extended character   is not valid in an identifier
   24 |   
      | ^
a.cc:24:1: error: extended character   is not valid in an identifier
a.cc:26:1: error: extended character   is not valid in an identifier
   26 |     n = read();
      | ^
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 |     for (int i = 1; i <= n; i++) {
      | ^
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 |         int L = read();
      | ^
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 |         int R = read();
      | ^
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: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: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 |         l[Maxv + R]++;
      | ^
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: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 |         r[Maxv + L]++;
      | ^
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: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: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 |     }
      | ^
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 |     l[Maxv]++;
      | ^
a.cc:33:1: error: extended character �