Language: C++

	#include <bits/stdc++.h>
	using namespace std;
	#define show(x) cerr << #x << " = " << x << ", "
	#define showln(x) cerr << #x << " = " << x << "\n"
	typedef long long ll;
	bool fexists(const char *filename) {
	  std::ifstream ifile(filename);
	  return (bool)ifile;
	}
	int a[1000002];
	vector <int> help;
	int ans = 0;
	void MS(int l, int r){
		if (r - l == 1)
	        return;
	    int m = (l + r) / 2;
	    MS(l, m);
	    MS(m, r);
	    int x = l;
	    int y = m;
	    help.clear();
	    while (x < m || y < r){
	        if (y >= r || (x < m && a[x] <= a[y])){
	   	 		ans++;
	            help.push_back(a[x]);
	            x++;
	        }    
	        else
	            if (x >= m || a[x] > a[y]){
	            ans++;
	   
	            help.push_back(a[y]);
	                y++;
	            }            
	     	
	    }
	    for (int k = 0; k < help.size(); ++k)
	        a[k + l] = help[k];
	}
	int main() {
		#ifndef ONLINE_JUDGE
			if (!fexists(".in"))
				freopen(".in", "w", stdout);	
			freopen(".in", "r", stdin);
			freopen(".out", "w", stdout);
		#endif
		ios_base::sync_with_stdio(false);
		int n;
		cin >> n;
		for (int i = 1; i <= n; ++i)
			cin >> a[i];
		MS(1, n + 1);
		for (int i = 1; i <= n; ++i) {
			cout << a[i] << " ";
		}
		cout << "\n" << ans << endl;
		return 0;
	}	#include <bits/stdc++.h>
	using namespace std;
	#define show(x) cerr << #x << " = " << x << ", "
	#define showln(x) cerr << #x << " = " << x << "\n"
	typedef long long ll;
	bool fexists(const char *filename) {
	  std::ifstream ifile(filename);
	  return (bool)ifile;
	}
	int a[1000002];
	vector <int> help;
	int ans = 0;
	void MS(int l, int r){
		if (r - l == 1)
	        return;
	    int m = (l + r) / 2;
	    MS(l, m);
	    MS(m, r);
	    int x = l;
	    int y = m;
	    help.clear();
	    while (x < m || y < r){
	        if (y >= r || (x < m && a[x] <= a[y])){
	   	 		ans++;
	            help.push_back(a[x]);
	            x++;
	        }    
	        else
	            if (x >= m || a[x] > a[y]){
	            ans++;
	   
	            help.push_back(a[y]);
	                y++;
	            }            
	     	
	    }
	    for (int k = 0; k < help.size(); ++k)
	        a[k + l] = help[k];
	}
	
		ios_base::sync_with_stdio(false);
		int n;
		cin >> n;
		for (int i = 1; i <= n; ++i)
			cin >> a[i];
		MS(1, n + 1);
		for (int i = 1; i <= n; ++i) {
			cout << a[i] << " ";
		}
		cout << "\n" << ans << endl;
		return 0;
	}


Compiler output:
a.cc:58:17: error: stray '#' in program
   58 |         }       #include <bits/stdc++.h>
      |                 ^
a.cc:58:18: error: 'include' does not name a type
   58 |         }       #include <bits/stdc++.h>
      |                  ^~~~~~~
a.cc:63:14: error: redefinition of 'bool fexists(const char*)'
   63 |         bool fexists(const char *filename) {
      |              ^~~~~~~
a.cc:6:14: note: 'bool fexists(const char*)' previously defined here
    6 |         bool fexists(const char *filename) {
      |              ^~~~~~~
a.cc:67:13: error: redefinition of 'int a [1000002]'
   67 |         int a[1000002];
      |             ^
a.cc:10:13: note: 'int a [1000002]' previously declared here
   10 |         int a[1000002];
      |             ^
a.cc:68:22: error: redefinition of 'std::vector<int> help'
   68 |         vector <int> help;
      |                      ^~~~
a.cc:11:22: note: 'std::vector<int> help' previously declared here
   11 |         vector <int> help;
      |                      ^~~~
a.cc:69:13: error: redefinition of 'int ans'
   69 |         int ans = 0;
      |             ^~~
a.cc:12:13: note: 'int ans' previously defined here
   12 |         int ans = 0;
      |             ^~~
a.cc:70:14: error: redefinition of 'void MS(int, int)'
   70 |         void MS(int l, int r){
      |              ^~
a.cc:13:14: note: 'void MS(int, int)' previously defined here
   13 |         void MS(int l, int r){
      |              ^~
a.cc:98:42: error: expected constructor, destructor, or type conversion before '(' token
   98 |                 ios_base::sync_with_stdio(false);
      |                                          ^
a.cc:100:17: error: 'cin' does not name a type
  100 |                 cin >> n;
      |                 ^~~
a.cc:101:17: error: expected unqualified-id before 'for'
  101 |                 for (int i = 1; i <= n; ++i)
      |                 ^~~
a.cc:101:33: error: 'i' does not name a type
  101 |                 for (int i = 1; i <= n; ++i)
      |                                 ^
a.cc:101:41: error: expected unqualified-id before '++' token
  101 |                 for (int i = 1; i <= n; ++i)
      |                                         ^~
a.cc:103:19: error: expected constructor, destructor, or type conversion before '(' token
  103 |                 MS(1, n + 1);
      |                   ^
a.cc:104:17: error: expected unqualified-id before 'for'
  104 |                 for (int i = 1; i <= n; ++i) {
      |                 ^~~
a.cc:104:33: error: 'i' does not name a type
  104 |                 for (int i = 1; i <= n; ++i) {
      |                                 ^
a.cc:104:41: error: expected unqualified-id before '++' token
  104 |                 for (int i = 1; i <= n; ++i) {
      |                                         ^~
a.cc:107:17: error: 'cout' does not name a type
  107 |                 cout << "\n" << ans << endl;
      |                 ^~~~
a.cc:108:17: error: expected unqualified-id before 'return'
  108 |                 return 0;
      |                 ^~~~~~
a.cc:109:9: error: expected declaration before '}' token
  109 |         }
      |         ^