Language: C++

#include<iostream>
using namespace std;
#define MAX 500000;
#define SENTINEL 2000000000;

int L[MAX / 2 + 2];
int R[MAX / 2 + 2];
int cnt;

void merge(int A[], int n, int left, int mid, int right) {
	int n1 = mid - left;
	int n2 = right - mid;
	for (int i = 0; i < n1; i++) {
		L[i] = A[left + i];
	}
	for (int i = 0; i < n2; i++) {
		R[i] = A[right + i];
	}
	L[n1] = R[n2] = SENTINEL;
	int i = 0, j = 0;
	for (int k = left; k < right; k++) {
		cnt++;
		if (L[i] <= R[i]) {
			A[k] = L[i++];
		}
		else {
			A[k] = R[j++];
		}
	}
}

void mergesort(int B[], int n, int left, int right) {
	if (left + 1 < right) {
		int mid = (left + right) / 2;
		mergesort(B, n, left, mid);
		mergesort(B, n, mid, right);
		merge(B, n, left, mid, right);
	}
}

int main()
{
	int C[MAX], n, i;
	cnt = 0;
	cin >> n;
	for (i = 0; i < n, i++) cin >> C[i];

	mergesort(C, n, 0, n);

	for (i = 0; i < n; i++) {
		if (i)cout << " ";
		cout << C[i];
	}
	cout << endl;
	cout << cnt << endl;
    return 0;
}

Compiler output:
a.cc:3:19: error: expected ']' before ';' token
    3 | #define MAX 500000;
      |                   ^
a.cc:6:7: note: in expansion of macro 'MAX'
    6 | int L[MAX / 2 + 2];
      |       ^~~
a.cc:6:11: error: expected unqualified-id before '/' token
    6 | int L[MAX / 2 + 2];
      |           ^
a.cc:3:19: error: expected ']' before ';' token
    3 | #define MAX 500000;
      |                   ^
a.cc:7:7: note: in expansion of macro 'MAX'
    7 | int R[MAX / 2 + 2];
      |       ^~~
a.cc:7:11: error: expected unqualified-id before '/' token
    7 | int R[MAX / 2 + 2];
      |           ^
a.cc: In function 'void merge(int*, int, int, int, int)':
a.cc:14:17: error: 'L' was not declared in this scope
   14 |                 L[i] = A[left + i];
      |                 ^
a.cc:17:17: error: 'R' was not declared in this scope
   17 |                 R[i] = A[right + i];
      |                 ^
a.cc:19:9: error: 'L' was not declared in this scope
   19 |         L[n1] = R[n2] = SENTINEL;
      |         ^
a.cc:19:17: error: 'R' was not declared in this scope
   19 |         L[n1] = R[n2] = SENTINEL;
      |                 ^
a.cc: In function 'int main()':
a.cc:3:19: error: expected ']' before ';' token
    3 | #define MAX 500000;
      |                   ^
a.cc:43:15: note: in expansion of macro 'MAX'
   43 |         int C[MAX], n, i;
      |               ^~~
a.cc:43:18: error: expected primary-expression before ']' token
   43 |         int C[MAX], n, i;
      |                  ^
a.cc:45:16: error: 'n' was not declared in this scope
   45 |         cin >> n;
      |                ^
a.cc:46:14: error: 'i' was not declared in this scope
   46 |         for (i = 0; i < n, i++) cin >> C[i];
      |              ^
a.cc:46:31: error: expected ';' before ')' token
   46 |         for (i = 0; i < n, i++) cin >> C[i];
      |                               ^
      |                               ;
a.cc:46:40: error: 'C' was not declared in this scope
   46 |         for (i = 0; i < n, i++) cin >> C[i];
      |                                        ^
a.cc:48:19: error: 'C' was not declared in this scope
   48 |         mergesort(C, n, 0, n);
      |                   ^
a.cc:50:14: error: 'i' was not declared in this scope
   50 |         for (i = 0; i < n; i++) {
      |              ^