Language: C++

#include <iostream>
#include <cstdio>
using namespace std;
long long ll;

int S = 0
ll A[2000000], cnt = 0;
 
int merge(int l, int m, int r){
    int n1 = m - l, n2 = r - m, i, j;
    ll L[n1 + 1], R[n2 + 1];
    for(i = 0;i < n1;i++)L[i] = A[i + l];
    for(i = 0;i < n2;i++)R[i] = A[i + m];
    i = j = 0;
    for(int k = 0;k < r - l;k++){
        if(j == n2 || (i < n1 && L[i] <= R[j]))A[k + l] = L[i++];
        else A[k + l] = R[j++], cnt += n1 - i;
        S++;
    }
}

int mergeSort(int l, int r){
    if(l + 1 < r){
        int m = (l + r) / 2;
        mergeSort(l, m);
        mergeSort(m, r);
        merge(l, m, r);
    }
}
 
int main(){
    int n;
    scanf("%d", &n);
    for(int i = 0;i < n;i++)scanf("%d", &A[i]);
    mergeSort(0, n);
    /*for(int i = 0;i < n;i++){
        if(i)printf(" ");
        printf("%d", A[i]);
    }
    printf("\n%d\n", S);*/
	printf("%d\n", cnt);
     
    return 0;
}

Compiler output:
a.cc:7:1: error: expected ',' or ';' before 'll'
    7 | ll A[2000000], cnt = 0;
      | ^~
a.cc: In function 'int merge(int, int, int)':
a.cc:11:7: error: expected ';' before 'L'
   11 |     ll L[n1 + 1], R[n2 + 1];
      |       ^~
      |       ;
a.cc:12:26: error: 'L' was not declared in this scope
   12 |     for(i = 0;i < n1;i++)L[i] = A[i + l];
      |                          ^
a.cc:12:33: error: 'A' was not declared in this scope
   12 |     for(i = 0;i < n1;i++)L[i] = A[i + l];
      |                                 ^
a.cc:13:26: error: 'R' was not declared in this scope
   13 |     for(i = 0;i < n2;i++)R[i] = A[i + m];
      |                          ^
a.cc:13:33: error: 'A' was not declared in this scope
   13 |     for(i = 0;i < n2;i++)R[i] = A[i + m];
      |                                 ^
a.cc:16:34: error: 'L' was not declared in this scope
   16 |         if(j == n2 || (i < n1 && L[i] <= R[j]))A[k + l] = L[i++];
      |                                  ^
a.cc:16:42: error: 'R' was not declared in this scope
   16 |         if(j == n2 || (i < n1 && L[i] <= R[j]))A[k + l] = L[i++];
      |                                          ^
a.cc:16:48: error: 'A' was not declared in this scope
   16 |         if(j == n2 || (i < n1 && L[i] <= R[j]))A[k + l] = L[i++];
      |                                                ^
a.cc:17:14: error: 'A' was not declared in this scope
   17 |         else A[k + l] = R[j++], cnt += n1 - i;
      |              ^
a.cc:17:33: error: 'cnt' was not declared in this scope; did you mean 'int'?
   17 |         else A[k + l] = R[j++], cnt += n1 - i;
      |                                 ^~~
      |                                 int
a.cc:20:1: warning: no return statement in function returning non-void [-Wreturn-type]
   20 | }
      | ^
a.cc: In function 'int mergeSort(int, int)':
a.cc:29:1: warning: no return statement in function returning non-void [-Wreturn-type]
   29 | }
      | ^
a.cc: In function 'int main()':
a.cc:34:42: error: 'A' was not declared in this scope
   34 |     for(int i = 0;i < n;i++)scanf("%d", &A[i]);
      |                                          ^
a.cc:41:24: error: 'cnt' was not declared in this scope; did you mean 'int'?
   41 |         printf("%d\n", cnt);
      |                        ^~~
      |                        int