criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
#include <vector>
using namespace std;

using pll = pair<long long, long long>;
int N;
vector<pll> pos;

int main() {
    while (cin >> N) {
        pos.resize(N);
        for (int i = 0; i < N; ++i) {
            cin >> pos[i].first >> pos[i].second;
        }
        
        bool ok = true;
        long long maxd = 0;
        int par = (abs(pos[0].first) + abs(pos[0].second)) % 2;
        for (int i = 0; i < N; ++i) {
            int par2 = (abs(pos[i].first) + abs(pos[i].second)) % 2;
            if (par2 != par) ok = false;
            
            chmax(maxd, abs(pos[i].first) + abs(pos[i].second));
        }
        
        if (!ok) {
            cout << -1 << endl;
            continue;
        }
        
        if (maxd > 40) {
            cout << -1 << endl;
            continue;
        }
        
        cout << maxd << endl;
        for (int i = 0; i < maxd; ++i) cout << 1 << " ";
        cout << endl;
        
        for (int i = 0; i < N; ++i) {
            for (int j = 0; j < abs(pos[i].first); ++j) {
                if (pos[i].first > 0) cout << "R";
                else cout << "L";
            }
            for (int j = 0; j < abs(pos[i].second); ++j) {
                if (pos[i].second > 0) cout << "U";
                else cout << "D";
            }
            for (int j = 0; j + abs(pos[i].first) + abs(pos[i].second) < maxd; j += 2) {
                cout << "LR";
            }
            cout << endl;
        }
        
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:13: error: 'chmax' was not declared in this scope
   23 |             chmax(maxd, abs(pos[i].first) + abs(pos[i].second));
      |             ^~~~~
Language: C++

#include <iostream>
#include <cmath>

using namespace std;

int main() {
    int N, m;
    int X[1003], Y[1003];

    cin >> N;

    int even = 0, odd = 0;
    for (int i = 0; i < N; i++) {
        cin >> X[i] >> Y[i];
        if ( (X[i] + Y[i]) % 2 == 0) {
            even++;
        } else {
            odd++;
        }
    }
    if (even && odd) {
        cout << -1 << endl;
        return 0;
    }

    if ( abs(X[i]) > 10 || abs(Y[i]) > 10) {
        cout << -1 << endl;
        return 0;
    }

    if (even) { m = 22; }
    else { m = 21; }
    for (int i = 0; i < m; i++) {
        cout << 1;
        if (i == m-1) { cout << endl; }
        else { cout << " "; }
    }
    for (int i = 0; i < N; i++) {
        if (X[i] <= 0) {
            for (int j = 0; j < abs(X[i]); j++) {
                cout << "L";
            }
        } else {
            for (int j = 0; j < X[i]; j++) {
                cout << "R";
            }
        }
        if (Y[i] <= 0) {
            for (int j = 0; j < abs(Y[i]); j++) {
                cout << "D";
            }
        } else {
            for (int j = 0; j < Y[i]; j++) {
                cout << "U";
            }
        }
        for (int j = 0; j < m - abs(X[i]) - abs(Y[i]); j++) {
            if (j % 2) { cout << "L"; }
            else { cout << "R"; }
        }
        cout << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:16: error: 'i' was not declared in this scope
   26 |     if ( abs(X[i]) > 10 || abs(Y[i]) > 10) {
      |                ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <cmath>

#define TEST 0

using namespace std;

int main()
{
    int N, i, j, flag = 0, flag2 = 0;
    cin >> N;
    
    vector<int> X(N);
    vector<int> Y(N);
    vector<int> U(N);
    vector<int> V(N);

    for (i=0; i<N; i++){
        cin >> X.at(i);
        cin >> Y.at(i);
        U[i] = X[i] + Y[i];
        V[i] = X[i] - Y[i];

        if (i>0){
            if ( abs( (X[i] + Y[i]) % 2 ) != abs( (X[i-1] + Y[i-1]) % 2 ) ){
                flag = 1;
            }
        }
    }

    if (flag) {cout << -1 << '\n'; return -1;}

    if ((X[0] + Y[0]) % 2 == 0){
        flag2 = 1;
        for (i=0; i<N; i++){
            X[i] = X[i] - 1;
            U[i] = X[i] + Y[i];
            V[i] = X[i] - Y[i];
        }
    }

    int m, deci1, deci2;

    int minU = *min_element(U.begin(), U.end());
    int maxU = *max_element(U.begin(), U.end());
    int minV = *min_element(V.begin(), V.end());
    int maxV = *max_element(V.begin(), V.end());

    int lim = max (max(abs(minU), abs(maxU)), max(abs(minV), abs(maxV)));

    if (TEST) cout << "lim = " << lim << '\n';

    for (i=1; i<41; i++){
        if (pow(2,i)-1 >= lim) {
            m = i;
            break;
            }
    }

    if (flag2) cout << m+1 << '\n';
    else cout << m << '\n';

    vector<int> d(m);

    for (i=0; i<m; i++){
        d[i] = pow(2, i);
        cout << d[i] << ' ';
    }
    if (flag2) cout << 1;
    cout << '\n';

    vector<int> UU(m);
    vector<int> VV(m);
    for (i=0; i<N; i++){
        deci1 = (U[i] + pow(2, m) - 1) / 2;
        if (TEST) cout << deci1 << '\n';
        for (j=0; j<m; j++){
            UU[j] = deci1 % 2;
            deci1 /= 2; // opposite order to bonary representation
        }

        deci2 = (V[i] + pow(2, m) - 1) / 2;
        
        for (j=0; j<m; j++){
            VV[j] = deci2 % 2;
            deci2 /= 2; // opposite order to bonary representation
        }

        for (j=0; j<m; j++){
            if (UU[j] == 1 && VV[j] == 1) cout << 'R';
            else if (UU[j] == 1 && VV[j] == 0) cout << 'U';
            else if (UU[j] == 0 && VV[j] == 1) cout << 'D';
            else if (UU[j] == 0 && VV[j] == 0) cout << 'L';
        }
        if (flag2) cout << 'R';
        cout << '\n';

    }


    if (TEST){
        cout << "UU = ";
        for (i=0; i<m; i++){
            cout << UU[i];
        }
        cout << '\n' << "VV = ";
        for (i=0; i<m; i++){
            cout << VV[i];
        }
        cout << '\n';
    }
    
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:17: error: 'min_element' was not declared in this scope
   46 |     int minU = *min_element(U.begin(), U.end());
      |                 ^~~~~~~~~~~
a.cc:47:17: error: 'max_element' was not declared in this scope
   47 |     int maxU = *max_element(U.begin(), U.end());
      |                 ^~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define LL long long
using namespace std;
const int maxn = 1010;
int n;
LL x[maxn],y[maxn],u[maxn],v[maxn],bs[35];

LL power_int(int a, int b) {
  LL x = 1;
  while (b > 0) {x *= a;b--;}
  return x;
//  return bs[b];
}

void work() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i];

  LL parity = (x[0] + y[0]) % 2;

  for (int i = 0; i < n; i++) if ((x[i] + y[i] - parity) % 2 != 0) {cout<<"-1"<<endl;return;}

    if (parity == 0) {
        cout << 32 << endl;
        for (int i = 30; i > -1; i--) cout << power_int(2, i) << " ";
        cout << 1 << endl;
        for (int i = 0; i < n; i++) x[i]++;
    } else {
        cout << 31 << endl;
        for (int i = 30; i > -1; i--)  << power_int(2, i) << " ";
        cout << endl;
    }

    for (int i = 0; i < n; i++) u[i] = x[i] + y[i], v[i] = x[i] - y[i];

    for (int i = 0; i < n; i++) {
        for (int j = 30; j > -1; j--) {
            if (u[i] > 0 && v[i] > 0) {cout << 'R'; u[i] -= power_int(2, j); v[i] -= power_int(2, j); }
            else if (u[i] > 0 && v[i] < 0) { cout << 'U'; u[i] -= power_int(2, j); v[i] += power_int(2, j); }
            else if (u[i] < 0 && v[i] > 0) { cout << 'D'; u[i] += power_int(2, j); v[i] -= power_int(2, j); }
            else { cout << 'L'; u[i] += power_int(2, j); v[i] += power_int(2, j);}
        }
        if (parity == 0) cout << 'L';
        cout << endl;
    }
}
int main(){
    bs[0] = 1LL;
    for (int i=1;i<32;i++) bs[i] = bs[i-1]<<1;
    work();
    return 0;
}


Compiler output:
a.cc: In function 'void work()':
a.cc:30:40: error: expected primary-expression before '<<' token
   30 |         for (int i = 30; i > -1; i--)  << power_int(2, i) << " ";
      |                                        ^~
Language: C++

#include <bits/stdc++.h>
#define LL long long
using namespace std;
const int maxn = 1010;
int n;
LL x[maxn],y[maxn],u[maxn],v[maxn],bs[35];

LL power_int(int a, int b) {
  LL x = 1;
  while (b > 0) {x *= a;b--;}
  return x;
}

void work() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i];

  LL parity = (x[0] + y[0]) % 2;

  for (int i = 0; i < n; i++) if ((x[i] + y[i] - parity) % 2 != 0) {cout<<"-1"<<endl;return;}

    if (parity == 0) {
      cout << 32 << endl;
      for (int i = 30; i > -1; i--) {
        cout << power_int(2, i) << " ";
      }
      cout << 1 << endl;
      for (int i = 0; i < n; i++) {
        x[i]++;
      }
    }
    else {
      cout << 31 << endl;
      for (int i = 30; i > -1; i--) {
        cout << power_int(2, i) << " ";
      }
      cout << endl;
    }
    for (int i = 0; i < n; i++) u[i] = x[i] + y[i], v[i] = x[i] - y[i];

    for (int i = 0; i < n; i++) {
        for (int j = 30; j > -1; j--) {
            if (u[i] > 0 && v[i] > 0) {cout << 'R'; u[i] -= bs[j];  v[i] -= bs[j];}//x[i] > y[i] & x[i] > 0
            else if (u[i] > 0 && v[i] < 0) {cout << 'U'; u[i] -= bs[j];  v[i] += bs[j];}//y[i] > x[i] & y[i] > 0
            else if (u[i] < 0 && v[i] > 0) {cout << 'D'; u[i] += bs[j];  v[i] -= bs[j];}//x[i] > y[i] && y[i] < 0
            else {cout << 'L'; u[i] += bs[j];  v[i] += bs[j];}//x[i] < y[i] & x[i] < 0;
      }
      if (sum == 0) cout << 'L';
      cout << endl;
    }
}
int main(){
    work();
    return 0;
}


Compiler output:
a.cc: In function 'void work()':
a.cc:48:11: error: 'sum' was not declared in this scope
   48 |       if (sum == 0) cout << 'L';
      |           ^~~
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <cstdlib>
using namespace std;
using ll = long long int;

int main()
{
    int N;
    cin >> N;
    vector<pair<int,int>> XY;
    for (int i = 0; i < N; i++) {
        int x;
        int y;
        cin >> x >> y;
        XY.push_back(make_pair(x,y));
    }
    int mod = abs((XY[0].first + XY[0].second) % 2);
    for (int i = 0; i < N; i++) {
        if (abs((XY[i].first + XY[i].second) % 2) != mod){
            cout << -1 << endl;
            return 0;
        }
    }

    vector<int> Arm;
    int p2 = 1;
    Arm.push_back(1);
    for (int i = 0; i < 30; i++) {
        p2*=2;
        Arm.push_back(p2);
    }
    if (mod == 0){
        Arm.push_back(1);
        ans += 1;
    }
    reverse(Arm.begin(),Arm.end());

    int ans = 31;
    cout << ans << endl;
    for (int i = 0; i < Arm.size(); i++) {
        cout << Arm[i] << ' ';
    }
    cout << endl;

    for (int i = 0; i < N; i++) {
        int x = XY[i].first, y = XY[i].second;
        for (int j = 0; j < Arm.size(); j++) {
            if (x+y > 0 && x-y > 0) {
                cout << "R";
                x -= Arm[j];
            }
            else if(x+y > 0 && x-y < 0) {
                cout << "U";
                y -= Arm[j];
            }
            else if(x+y < 0 && x-y > 0) {
                cout << "D";
                y += Arm[j];
            }
            else if (x+y < 0 && x-y < 0) {
                cout << "L";
                x += Arm[i];
            }
        }
        cout << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   42 |         ans += 1;
      |         ^~~
      |         abs
Language: C++

#include<iostream>
#include<string>
#include<string.h>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
using namespace std;

int x[2010],y[2010],pow[2010],sum[2010],n;
int main()
{
    scanf("%d",&n);int i,j;
    for (i=1;i<=n;i++) 
    {
        scanf("%d%d",&x[i],&y[i]);
        sum[i]=abs(x[i]+y[i]);
    }
    for (i=1;i<n;i++)
        if (sum[i]%2!=sum[i+1]%2) {printf("%d",-1);return 0;}
    int maxd=0,cnt=0;
    for (i=1;i<=n;i++) maxd=max(maxd,sum[i]);
    if  (!(sum[1]%2)) {pow[++cnt]=1;maxn--;} 
    int tmp=1;
    while (tmp<=maxd+1) {pow[++cnt]=tmp;tmp*=2;}
    printf("%d\n",cnt);
    for (i=1;i<=cnt;i++) printf("%d ",pow[cnt-i+1]);printf("\n");
    for (i=1;i<=n;i++)
    {
        int fx=x[i],fy=y[i],nx=0,ny=0;
        for (j=cnt;j>=1;j--)
        {
            int chax=fx-nx,chay=fy-ny;
            if (abs(chax)>abs(chay))
            {
                if (chax>0) {printf("R");nx+=pow[j];}
                else {printf("L");nx-=pow[j];}
            }
            else 
            {
                if (chay>0) {printf("U");ny+=pow[j];}
                else {printf("D");ny-=pow[j];}
            }
        }
        printf("\n");
    }
    return 0;
}

Compiler output:
a.cc:11:21: warning: built-in function 'pow' declared as non-function [-Wbuiltin-declaration-mismatch]
   11 | int x[2010],y[2010],pow[2010],sum[2010],n;
      |                     ^~~
a.cc: In function 'int main()':
a.cc:24:37: error: 'maxn' was not declared in this scope; did you mean 'maxd'?
   24 |     if  (!(sum[1]%2)) {pow[++cnt]=1;maxn--;}
      |                                     ^~~~
      |                                     maxd
Language: C++

def d_robot_arms(N, Pos):
    # 参考: http://drken1215.hatenablog.com/entry/2018/09/30/002900
    ans = []

    pos = []
    parity = (abs(Pos[0][0]) + abs(Pos[0][1])) % 2
    for x, y in Pos:
        parity_current = (abs(x) + abs(y)) % 2
        if parity != parity_current:
            return -1
        pos.append([x + y, x - y])

    d = []
    for i in range(30, -1, -1):
        d.append(1 << i)
    if parity % 2 == 0:
        d.append(1)
    ans.append(str(len(d)))
    ans.append(' '.join(list(map(str, d))))

    for i in range(N):
        xdir, ydir = 0, 0
        xsum, ysum = 0, 0
        tmp = []
        for j in range(len(d)):
            if xsum <= pos[i][0]:
                xdir = 1
                xsum += d[j]
            else:
                xdir = -1
                xsum -= d[j]
            
            if ysum <= pos[i][1]:
                ydir = 1
                ysum += d[j]
            else:
                ydir = -1
                ysum -= d[j]
            
            if xdir == 1 and ydir==1:
                tmp.append('R')
            elif xdir == 1 and ydir==-1:
                tmp.append('D')
            elif xdir == -1 and ydir==-1:
                tmp.append('L')
            else:
                tmp.append('U')
        ans.append(''.join(tmp))
    ans = '\n'.join(ans)
    return ans

N = int(input())
Pos = [[int(i) for i in input().split()] for j in range(N)]
print(d_robot_arms(N, Pos))

Compiler output:
a.cc:2:7: error: invalid preprocessing directive #\U000053c2\U00008003
    2 |     # 参考: http://drken1215.hatenablog.com/entry/2018/09/30/002900
      |       ^~~~
a.cc:48:20: error: empty character constant
   48 |         ans.append(''.join(tmp))
      |                    ^~
a.cc:1:1: error: 'def' does not name a type
    1 | def d_robot_arms(N, Pos):
      | ^~~
Language: C++

#include <bits/stdc++.h>
#define INF (1<<30)
#define MOD 1000000007
#define l_ength size
using ll = long long;
using namespace std;

int main(){
	int n;
	cin >> n;
	vector<pair<int, int>> v(n);
	bool flag = false;
	bool flag2 = false;
	int guuki;
	for( int i = 0; i < n; ++i ){
		int x, y;
		cin >> x >> y;
		if( x > 10 ) return 0;
		if( y > 10 ) return 0;
		v.at(i).first = x;
		v.at(i).second = y;
		if( !flag ){
			guuki = (abs(x)+abs(y))%2;
			flag = true;
		} else if( (abs(x)+abs(y))%2 != guuki ){
			flag2 = true;
		}
	}
	if( flag2 ){
		cout << "-1" << endl;
		return 0; 
	}
	cout << "20" << endl;
    cout << "1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1" << endl;
	for( int i = 0; i < n; ++i ){
		int x, y;
		x = v.at(i).first;
		y = v.at(i).second;
		if( x < 0 ){
			x = -x;
			for( int j = 0; j < x; ++j )  cout << 'L';
		} else {
			for( int j = 0; j < x; ++j )  cout << 'R';
		}
		if( y < 0 ){
			y = -y;
			for( int j = 0; j < y; ++j )  cout << 'D';
		} else {
			for( int j = 0; j < y; ++j )  cout << 'U';
		}
		if( x + y < 20 ){
			for( int j = 0; j < ( sum - x - y )/2; ++j ) cout << "LR"; 
		}
		cout << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:47: error: 'sum' was not declared in this scope
   52 |                         for( int j = 0; j < ( sum - x - y )/2; ++j ) cout << "LR";
      |                                               ^~~
Language: C++

#include <bits/stdc++.h>
#define INF (1<<30)
#define MOD 1000000007
#define l_ength size
using ll = long long;
using namespace std;

int main(){
	int n;
	cin >> n;
	vector<pair<int, int>> v(n);
	bool flag = false;
	bool flag2 = false;
	int guuki;
	for( int i = 0; i < n; ++i ){
		int x, y;
		cin >> x >> y;
		if( x > 10 ) return 0;
		if( y > 10 ) return 0;
		v.at(i).first = x;
		v.at(i).second = y;
		if( !flag ){
			guuki = (abs(x)+abs(y))%2;
			flag = true;
		} else if( (abs(x)+abs(y))%2 != guuki ){
			flag2 = true;
		}
	}
	if( flag2 ){
		cout << "-1" << endl;
		return 0; 
	}
	cout << "20" << endl;
    cout << "1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1" << endl;
	for( int i = 0; i < sum; ++i ){
		int x, y;
		x = v.at(i).first;
		y = v.at(i).second;
		if( x < 0 ){
			x = -x;
			for( int j = 0; j < x; ++j )  cout << 'L';
		} else {
			for( int j = 0; j < x; ++j )  cout << 'R';
		}
		if( y < 0 ){
			y = -y;
			for( int j = 0; j < y; ++j )  cout << 'D';
		} else {
			for( int j = 0; j < y; ++j )  cout << 'U';
		}
		if( x + y < 20 ){
			for( int j = 0; j < ( sum - x - y )/2; ++j ) cout << "LR"; 
		}
		cout << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:29: error: 'sum' was not declared in this scope
   35 |         for( int i = 0; i < sum; ++i ){
      |                             ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
	int n,i,j,ch=-1,run=4,maxbu=0,bu=0,na,nb,co;
	cin>>n;
	int a[n+1],b[n+1];
	for(i=1;i<=n;i++){
		cin>>a[i]>>b[i];
	}
	if(a[1]<0) ch=-a[1];
	else ch=a[1];
	if(b[1]<0) ch-=b[1];
	else ch+=b[1];
	ch=ch%2;
	for(i=1;i<=n;i++){
		if(a[i]>0) bu=a[i];
		else bu=-a[i];
		if(b[i]>0) bu+=b[i];
		else bu-=b[i];
		if(bu>maxbu) maxbu=bu;
		if(ch!=bu%2){
			cout<<"-1";
			return 0;
		}
	}
	cout<<maxbu<<endl<<'1';
	for(i=2;i<=maxbu;i++){
		cout<<" 1";
	}
	cout<<endl;
	for(i=1;i<=n;i++){
		na=0;
		nb=0;
		co=0;
		while(run!=0){
		run=0;
		if(a[i]<na){
			run++;
			na--;
			cout<<'L';
		}
		else if(a[i]>na){
			run++;
			na++;
			cout<<'R';
		}
		if(b[i]<nb){
			run++;
			nb--;
			cout<<'D';
		}
		else if(b[i]>nb){
			run++;
			nb++;
			cout<<'U';
		}
	}
		if(co<maxbu){
			for(j=1;j<=(maxbu-co)/2;j++){
				cout<<"UD";
			}
		
		cout<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:67:2: error: expected '}' at end of input
   67 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include "bits/stdc++.h"
using namespace std;

const int N = 1005;
int x[N], y[N];

int main() {
    int n;
    scanf("%d", &n);

    for(int i = 0; i < n; ++i) {
        cin >> x[i] >> y[i];
        if(i) {
           int a = abs(x[i - 1] + y[i - 1]);
           int b = abs(x[i] + y[i]);
           if(a % 2 != b % 2) return !printf("-1");
        }
    }  

    int m = 19;
    if(abs(x[i] + y[i]) % 2 == 0) m++;
    printf("%d\n", m);
    for(int i = 0; i < m; ++i) {
        if(i) printf(" ");
        printf("1");
    }
    puts("");

    for(int i = 0; i < n; ++i) {

        int a = 0, b = 0;
        for(int j = 0; j < m; ++j) {
            if(a == x[i] and b == y[i]) {
                a--;
                printf("L");
            }
            else if(a < x[i]) {
                a ++;
                printf("R");
            }
            else if(b < y[i]) {
                b++;
                printf("U");
            }
            else if(a > x[i]) {
                a--;
                printf("L");
            }
            else if(b > y[i]) {
                b--;
                printf("D");
            }
        }
        puts("");
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:14: error: 'i' was not declared in this scope
   21 |     if(abs(x[i] + y[i]) % 2 == 0) m++;
      |              ^
Language: C

main(){puts("-1")};

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main(){puts("-1")};
      | ^~~~
main.c: In function 'main':
main.c:1:8: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
    1 | main(){puts("-1")};
      |        ^~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'puts'
  +++ |+#include <stdio.h>
    1 | main(){puts("-1")};
main.c:1:18: error: expected ';' before '}' token
    1 | main(){puts("-1")};
      |                  ^
      |                  ;
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<string>
#include<vector>
#include<map>
using namespace std;

int x[1005], y[1005], n;

int main()
{
    ios::sync_with_stdio(false);
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> x[i] >> y[i];
        if (abs(x[i]) > 10 || abs(y[i]) > 10)) assert(true);
    }
    int odd = (x[0] + y[0]) & 1;
    for (int i = 1; i < n; i++)
    {
        if ((x[i] - x[i-1] + y[i] - y[i-1]) & 1 != odd)
        {
            cout << -1 << endl;
            return 0;
        }
    }
    int sum = 40;
    if (odd) sum--;
    for (int i = 0; i < sum; i++)
    {
        cout << 1 << ' ';
    }
    cout << endl;
    int lastx = 0, lasty = 0;
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < abs(x[i] - lastx); j++)
        {
            if (x[i] - lastx < 0) cout << "L";
            else cout << "R";
        }
        for (int j = 0; j < abs(y[i] - lasty); j++ )
        {
            if (y[i] - lasty < 0) cout << "D";
            else cout << "U";
        }
        for (int j = sum - abs(x[i] - lastx) - abs(y[i] - lasty); j > 0; j-=2)
        {
            cout << "LR";
        }
        cout << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:46: error: expected primary-expression before ')' token
   20 |         if (abs(x[i]) > 10 || abs(y[i]) > 10)) assert(true);
      |                                              ^
Language: C++

#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{
	int n,p,v[1000001]={0},o[1000001]={0};
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&p);
		if(i%2==0){
			o[p]++;
		}
		else{
			v[p]++;
		}
	}
	n/=2;
	printf("%d\n",(n-*max_element(v+1, v+100000))+(n-*max_element(o + 1, o + 100000)));
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'i' was not declared in this scope
    8 |         for(i=0;i<n;i++){
      |             ^
Language: Java


import java.util.*;
import java.io.*;
public class Solution {

	public static void main(String[] args) throws java.lang.Exception {
		try {
			FastScanner fs = new FastScanner();
			int n = fs.nextInt();
			int a[]=new int[n];
			for(int i=0;i<n;i++)
			{
				a[i]=fs.nextInt();
			}
			int step=0;
			int first = a[0];
			int second=a[1];
			if(first==second)
			{
				step++;
				second=first+1;
			}
		
			for(int i=2;i<n;i+=2)
			{
				if(a[i]!=first)
				{
					step++;
				}
			}
			for(int i=3;i<n;i+=2)
			{
				if(a[i]!=second)
					step++;
			}
			
			System.out.println(step);
		}
		catch(Exception e) {
			return ;
		}
	}
	
	static class FastScanner 
    { 
       
		BufferedReader br; 
        StringTokenizer st; 
  
        public FastScanner() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
       
       
       
      }
	

}


Compiler output:
Main.java:4: error: class Solution is public, should be declared in a file named Solution.java
public class Solution {
       ^
1 error
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <queue>
#include <vector>
#include <deque>
using namespace std;
#define fors(i,a,b) for(int i=(a);i=(b);--i)
#define min(x,y) ((x) < (y) ? (x) : (y))
#define max(x,y) ((x) < (y) ? (y) : (x))
#define swap(x,y) ((x)^=(y),(y)^=(x),(x)^=(y))
const int maxn=1e6+7;
typedef long long ll;

int read(){
    int s=0,f=1;
    char c=getchar();
    while(c<'9' || c>'0') {if(c=='-') f=-1; c=getchar();}
    while(c>='0'&& c<='9') {s=s*10+c-48;c=getchar();}
    return s*f;
}
void write(int x){
    if(x9) write(x/10);
    putchar(x%10+48);
}
int n,a[maxn],cnt[2][maxn],mx1,mx11,mx2,mx22,n1,n2;
int main(int argc, char const *argv[])
{

    n=read();
    fors(i,1,n) {
        a[i]=read();
        ++cnt[i%2][a[i]];//用一个二维桶储存，cnt[0] 存的是偶数下标，cnt[1] 存的是奇数下标
    }
    fors(i, 1, maxn){//分别对奇数下标和偶数下标 从 1~100000 查询最大重复数的次数。
        if(cnt[0][i] > mx1){
            n1 = i;//n1 代表那个出现次数最多的众数
            mx11 = mx1;//mx11 存的是出现次数第二多的众数的个数
            mx1 = cnt[0][i];//mx1 存的是出现次数第一多的众数的个数
        }
        else if(cnt[0][i] > mx11){
            mx11 = cnt[0][i];
        }

        if(cnt[1][i] > mx2){//和上述相同
            n2 = i;
            mx22 = mx2;
            mx2 = cnt[1][i];
        }
        else if(cnt[1][i] > mx22){
            mx22 = cnt[1][i];
        }
    }
    //如果奇数和偶数下标的 n1 == n2 就采用第二大的众数个数
    if(n1 == n2){
        int mx = max(mx1 + mx22, mx2 + mx11);
        write(n - mx);
    }
    //否则直接相减
    else write(n/2-mx1 + n/2-mx2);
    return 0;
}

Compiler output:
a.cc: In function 'void write(int)':
a.cc:25:8: error: 'x9' was not declared in this scope; did you mean 'x'?
   25 |     if(x9) write(x/10);
      |        ^~
      |        x
Language: C

#include <stdio.h>

int main(void){
	int n,i,x,odd1=0,odd2=0,even1=0,even2=0;
	int j;
	int odd[100001]={0},even[100001]={0};

	scanf("%d",&n);
	for(i=0;i<n/2;i++){
		scanf("%d",&x);
		odd[x] = odd[x] +1;
		scanf("%d",&x);
		even[x] = even[x] +1;
	}

	for(i=0;i<100001;i++){
		if(odd1 < odd[i]){
			odd2 = odd1;
			odd1 = odd[i];
		}else if(odd2 < odd1[i]){
			odd2 = odd[i];
		}
		if(even1 < even[i]){
			even2 = even1;
			even1 = even[i];
		}else if(even2 < even1[i]){
			even2 = even[i];
		}
	}
	if(odd1 == even1){
		j = (odd1 + even2) > (odd2 + even1) ? (odd1 + even2) : (odd2 + even1);
	}else{
		j = odd1 + even1;
	}
	printf("%d\n",n-j);
}

Compiler output:
main.c: In function 'main':
main.c:20:37: error: subscripted value is neither array nor pointer nor vector
   20 |                 }else if(odd2 < odd1[i]){
      |                                     ^
main.c:26:39: error: subscripted value is neither array nor pointer nor vector
   26 |                 }else if(even2 < even1[i]){
      |                                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main () {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, ans;
  cin >> n;
  vector<int> a(n);
  for (int& i:a) cin >> i;
  map<int,int> fo,fe;
  for (int i = 0; i < n; ++i) fe[a[i]] += !(i & 1), fe += i & 1;
  if (fe.rbegin()->first != fo.rbegin()->first) ans = fe.rbegin()->second + fo.rbegin()->second;
  else ans = max(fe.rbegin()->second + prev(fo.rbegin())->second, prev(fe.rbegin())->second + fo.rbegin()->second);
  cout << n - ans;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:56: error: no match for 'operator+=' (operand types are 'std::map<int, int>' and 'int')
   13 |   for (int i = 0; i < n; ++i) fe[a[i]] += !(i & 1), fe += i & 1;
      |                                                     ~~~^~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main () {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> i;
  vector<int> a(n);
  for (int& i:a) cin >> n;
  vector<int> freqodd(100001,0), freqeven(100001,0);
  for (int i = 0; i < n; i += 2) freqeven[a[i]] += !(i & 1), freqodd[a[i]] += i & 1;
  int ans = *max_element(freqodd.begin(), freqodd.end());
  ans += *max_element(freqeven.begin(), freqeven.end());
  cout << n - ans;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: 'i' was not declared in this scope
    9 |   cin >> i;
      |          ^
Language: C++

#include <bits\stdc++.h>
using namespace std;

int main () {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int& i:a) cin >> i;
  vector<int> freqodd(100001), freqeven(100001);
  for (int i = 0; i < n; i += 2) freqeven[a[i]] += !(i & 1), freqodd[a[i]] += i & 1;
  int ans = *max_element(freqodd.begin(), freqodd.end());
  ans += *max_element(freqeven.begin(), freqeven.end());
  cout << n - ans;
  return 0;
}


Compiler output:
a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory
    1 | #include <bits\stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits\stdc++.h>
using namespace std;

int main () {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int& i:a) cin >> n;
  vector<int> freqodd(100001), freqeven(100001);
  for (int i = 0; i < n; i += 2) freqeven[a[i]] += !(i & 1), freqodd[a[i]] += i & 1;
  int ans = *max_element(freqodd.begin(), freqodd.end());
  ans += *max_element(freqeven.begin(), freqeven.end());
  cout << n - ans;
  return 0;
}

Compiler output:
a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory
    1 | #include <bits\stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#pragma GCC optimize ("Ofast")
#pragma GCC target ("avx,avx2")
#pragma GCC optimize ("trapv")
 
 
#include <bits/stdc++.h>
using namespace std;
 
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cin.exceptions(cin.failbit);
//#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define rep(i, a, b) for(lli i = a; i < (b); ++i)
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) (x).size()
#define what_is(x) cerr << #x << " is " << x << endl;
#define wis cout<<endl<<"I already speak english, bitch"<<endl<<endl;
 
typedef long long int lli;
typedef vector<lli> vi;
typedef pair<lli,lli> ii;
typedef vector<ii> vii;
typedef pair<ii,lli> iii;
 
#define trace(args...) { string  _s =#args; replace(_s.begin(), _s.end(), ',',' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args);}
void err(istream_iterator<string> it){}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args){
    cout <<  *it  << " : " << a << endl;
    err(++it, args...);
}
int main(){
	lli n; cin>>n;
	vi even,odd;
	lli eve=0,odi=0;
	map<lli,lli> m1,m2;
	rep(i,0,n){
		lli foo; cin>>foo;
		if(i%2==0) m1[foo]++,eve=max(eve,foo);
		else m2[foo]++,odi=max(odi,foo);
	}
	for(auto x : m1){
		even.pb(x.ss);
	}

	for(auto x : m2){
		odd.pb(x.ss);
	}
	sort(all(even));
	sort(all(odd));
	lli res1=even[sz(even)-1],res2=odd[sz(odd)-1];
	if(sz(even)>=3){
		for(int i=0;i<=n-3;i++) res1+=even[i];
	}
	if(sz(odd)>=3){
		for(int i=0;i<=n-3;i++) res2+=odd[i];
	}
 	lli sum1=0,sum2=0;
 	rep(i,0,sz(even)-1) sum1+=even[i];
 	rep(i,0,sz(odd)-1) sum2+=odd[i];

	if(eve==odi){
		if(odd[sz(odd)-1]>=even[sz(even)-1]) cout<<sum2+res1<<endl;
		else cout<<sum1+res2;
	}else cout<<sum1+sum2<<endl;

	return 0;
}

Compiler output:
In file included from /usr/include/c++/14/string:43,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:6:
/usr/include/c++/14/bits/allocator.h: In destructor 'std::_Vector_base<long long int, std::allocator<long long int> >::_Vector_impl::~_Vector_impl()':
/usr/include/c++/14/bits/allocator.h:182:7: error: inlining failed in call to 'always_inline' 'std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = long long int]': target specific option mismatch
  182 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:132:14: note: called from here
  132 |       struct _Vector_impl
      |              ^~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int cnt[2][100000], M[2], Q[2], m[2], q[2];
int n;
int main() {
	cin>>n;
	for (int i = 1, x, p; i <= n; i++) {
		cin>>x; p = i % 2;
		cnt[p][x]++;
		if (M[p] < cnt[p][x]) M[p] = cnt[p][x], Q[p] = x;
	}
	if (Q[0] != Q[1]) {
		cout<< n - M[0] - M[1];
		return 0;
	}
	for (int i = 1; i <= 100000; i++) {
		if (m[0] < cnt[0][i] && i != Q[0]) m[0] = cnt[0][i], q[0] = i;
		if (m[1] < cnt[1][i] && i != Q[1]) m[1] = cnt[1][i], q[1] = i;
	}
	if (M[0] - m[0] > M[1] - m[1]) cout<< n - M[0] - m[1];
	else cout<<n - m[0] - M[1];
	return 0;
}
　　



Compiler output:
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:24:1: error: '\U00003000\U00003000' does not name a type
   24 | 　　
      | ^~~~
Language: C++

#include<stdio.h>
#include<stdlib.h>

int main(){
   int n;
   scanf("%d",&n);

   int *array=calloc(n,sizeof(n));
   for(int i=0;i<n;i++){
        scanf("%d",&array[i]);
   }

   //MAIN ALGO
   int countOne=0, countTwo=0;
   for(int i=0; i<n-2;i=i+2){
        if(array[i]!=array[i+2]) countOne++;
   }
   for(int i=1; i<n-2;i=i+2){
        if(array[i]!=array[i+2]) countTwo++;
   }
   if(countOne+countTwo==0){
            if(array[0]=array[1]) countOne=(n/2);
   }
   printf("%d\n",countOne+countTwo);
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
    8 |    int *array=calloc(n,sizeof(n));
      |               ~~~~~~^~~~~~~~~~~~~
      |                     |
      |                     void*
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  long long int n;cin>>n;
  long long int a[n];=
  vector<long long int>odd,even;
    for(long long int i=0;i<n;i++){
      cin>>a[i];
    if(i%2)odd.push_back(a[i]);
      else even.push_back(a[i]);
    }
  unordered_map<long long int,long long int>fo,fe;
  for(long long int j=0;j<(n/2);j++)fo[odd[j]]++;
   for(long long int j=0;j<(n/2);j++)fe[even[j]]++;
  long long int max=0,mx=0,maxel,mxel,maxel2,mxel2,max2,mx2;
  for(auto i : fo){
    if(i.second >=max){
      max = i.second;
      maxel=i.first;
    }
  }
  for(auto i : fo){
    if(i.second >=max && i.first!=maxel){
      max2 = i.second;
      maxel2=i.first;
    }
  }
  for(auto i : fe){
    if(i.second >=mx){
      mx = i.second;
      mxel=i.first;
    }
  }
  for(auto i : fe){
    if(i.second >=mx && i.first!=mxel){
      mx2 = i.second;
      mxel2=i.first;
    }
  }
  if(maxel != mxel)cout<<n-max-mx<<endl;
  else{
    if((n-max-mx2>n-max2-mx)cout<<n-max-mx2;
       else cout<<n-max2-mx<<endl;
       }
       }
      
    
  
  
  
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:5:22: error: expected primary-expression before '=' token
    5 |   long long int a[n];=
      |                      ^
a.cc:6:24: error: expected primary-expression before 'odd'
    6 |   vector<long long int>odd,even;
      |                        ^~~
a.cc:9:12: error: 'odd' was not declared in this scope
    9 |     if(i%2)odd.push_back(a[i]);
      |            ^~~
a.cc:10:12: error: 'even' was not declared in this scope
   10 |       else even.push_back(a[i]);
      |            ^~~~
a.cc:13:40: error: 'odd' was not declared in this scope
   13 |   for(long long int j=0;j<(n/2);j++)fo[odd[j]]++;
      |                                        ^~~
a.cc:14:41: error: 'even' was not declared in this scope
   14 |    for(long long int j=0;j<(n/2);j++)fe[even[j]]++;
      |                                         ^~~~
a.cc:42:29: error: expected ';' before 'cout'
   42 |     if((n-max-mx2>n-max2-mx)cout<<n-max-mx2;
      |                             ^~~~
      |                             ;
a.cc:43:8: error: expected primary-expression before 'else'
   43 |        else cout<<n-max2-mx<<endl;
      |        ^~~~
a.cc:42:45: error: expected ')' before 'else'
   42 |     if((n-max-mx2>n-max2-mx)cout<<n-max-mx2;
      |       ~                                     ^
      |                                             )
   43 |        else cout<<n-max2-mx<<endl;
      |        ~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  long long int n;cin>>n;
  long long int a[n];=
  vector<long long int>odd,even;
    for(long long int i=0;i<n;i++){
      cin>>a[i];
    if(i%2)odd.push_back(a[i]);
      else evem.push_back(a[i]);
    }
  unordered_map<long long int,long long int>fo,fe;
  for(long long int j=0;j<(n/2);j++)fo[odd[j]]++;
   for(long long int j=0;j<(n/2);j++)fe[even[j]]++;
  long long int max=0,mx=0,maxel,mxel,maxel2,mxel2,max2,mx2;
  for(auto i : fo){
    if(i.second >=max){
      max = i.second;
      maxel=i.first;
    }
  }
  for(auto i : fo){
    if(i.second >=max && i.first!=maxel){
      max2 = i.second;
      maxel2=i.first;
    }
  }
  for(auto i : fe){
    if(i.second >=mx){
      mx = i.second;
      mxel=i.first;
    }
  }
  for(auto i : fe){
    if(i.second >=mx && i.first!=mxel){
      mx2 = i.second;
      mxel2=i.first;
    }
  }
  if(maxel !== mxel)cout<<n-max-mx<<endl;
  else{
    if((n-max-mx2>n-max2-mx)cout<<n-max-mx2;
       else cout<<n-max2-mx<<endl;
       }
       }
      
    
  
  
  
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:5:22: error: expected primary-expression before '=' token
    5 |   long long int a[n];=
      |                      ^
a.cc:6:24: error: expected primary-expression before 'odd'
    6 |   vector<long long int>odd,even;
      |                        ^~~
a.cc:9:12: error: 'odd' was not declared in this scope
    9 |     if(i%2)odd.push_back(a[i]);
      |            ^~~
a.cc:10:12: error: 'evem' was not declared in this scope
   10 |       else evem.push_back(a[i]);
      |            ^~~~
a.cc:13:40: error: 'odd' was not declared in this scope
   13 |   for(long long int j=0;j<(n/2);j++)fo[odd[j]]++;
      |                                        ^~~
a.cc:14:41: error: 'even' was not declared in this scope
   14 |    for(long long int j=0;j<(n/2);j++)fe[even[j]]++;
      |                                         ^~~~
a.cc:40:14: error: expected primary-expression before '=' token
   40 |   if(maxel !== mxel)cout<<n-max-mx<<endl;
      |              ^
a.cc:42:29: error: expected ';' before 'cout'
   42 |     if((n-max-mx2>n-max2-mx)cout<<n-max-mx2;
      |                             ^~~~
      |                             ;
a.cc:43:8: error: expected primary-expression before 'else'
   43 |        else cout<<n-max2-mx<<endl;
      |        ^~~~
a.cc:42:45: error: expected ')' before 'else'
   42 |     if((n-max-mx2>n-max2-mx)cout<<n-max-mx2;
      |       ~                                     ^
      |                                             )
   43 |        else cout<<n-max2-mx<<endl;
      |        ~~~~
Language: C

#include <stdio.h>
using namespace std;

int n,v[100005],m[100005],m1[100005],p1,p2,vp1,vp2,n1,n2,vn1,vn2;

int main()
{
    scanf("%d",&n);
    for(int i=0;i<n;i++)
        scanf("%d",&v[i]);
    for(int i=0;i<n;i+=2)
    {
        m[v[i]]++;
        if(m[v[i]]>p1)
        {
            if(vp1==v[i])
                p1++;
            else
            {
                p2=p1;
                vp2=vp1;
                p1=m[v[i]];
                vp1=v[i];
            }
        }
        else if(m[v[i]]>p2)
        {
            p2=m[v[i]];
            vp2=v[i];
        }
    }
    for(int i=1;i<n;i+=2)
    {
        m1[v[i]]++;
        if(m1[v[i]]>n1)
        {
            if(vn1==v[i])
                n1++;
            else
            {
                n2=n1;
                vn2=vn1;
                n1=m1[v[i]];
                vn1=v[i];
            }
        }
        else if(m1[v[i]]>n2)
        {
            n2=m1[v[i]];
            vn2=v[i];
        }
    }
    if(vp1!=vn1)
    {
        printf("%d",n-p1-n1);
        return 0;
    }
    else
    {
        if(n1>p1)
        {
            printf("%d",n-n1-p2);
            return 0;
        }
        else
        {
            printf("%d",n-p1-n2);
            return 0;
        }
    }

    return 0;
}


Compiler output:
main.c:2:1: error: unknown type name 'using'
    2 | using namespace std;
      | ^~~~~
main.c:2:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    2 | using namespace std;
      |                 ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
long long N;
long long L;
cin>>N;
long long counter=0;
long long a[N+10]={};
long long b[N+10}={};
long long ca=0;
for(long long i=0; i<N; i++){
cin>>L;
if(i%2==0){
a[L]++;}
else {
b[L]++;}}
counter=a[1];
ca=b[1];
for(long long i=1; i<N; i++){
counter=max(a[i],counter);
ca=max(b[i],ca);}
if(counter!=ca){
cout<<N-counter-ca<<endl;}
for(long long i=1; i<N; i++){
counter=max(a[i],counter);
ca=max(b[i],ca);}
else
cout<<L-N<<endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: expected ']' before '}' token
    9 | long long b[N+10}={};
      |                 ^
      |                 ]
a.cc: At global scope:
a.cc:9:18: error: expected unqualified-id before '=' token
    9 | long long b[N+10}={};
      |                  ^
a.cc:11:1: error: expected unqualified-id before 'for'
   11 | for(long long i=0; i<N; i++){
      | ^~~
a.cc:11:20: error: 'i' does not name a type
   11 | for(long long i=0; i<N; i++){
      |                    ^
a.cc:11:25: error: 'i' does not name a type
   11 | for(long long i=0; i<N; i++){
      |                         ^
a.cc:17:1: error: 'counter' does not name a type
   17 | counter=a[1];
      | ^~~~~~~
a.cc:18:1: error: 'ca' does not name a type
   18 | ca=b[1];
      | ^~
a.cc:19:1: error: expected unqualified-id before 'for'
   19 | for(long long i=1; i<N; i++){
      | ^~~
a.cc:19:20: error: 'i' does not name a type
   19 | for(long long i=1; i<N; i++){
      |                    ^
a.cc:19:25: error: 'i' does not name a type
   19 | for(long long i=1; i<N; i++){
      |                         ^
a.cc:22:1: error: expected unqualified-id before 'if'
   22 | if(counter!=ca){
      | ^~
a.cc:24:1: error: expected unqualified-id before 'for'
   24 | for(long long i=1; i<N; i++){
      | ^~~
a.cc:24:20: error: 'i' does not name a type
   24 | for(long long i=1; i<N; i++){
      |                    ^
a.cc:24:25: error: 'i' does not name a type
   24 | for(long long i=1; i<N; i++){
      |                         ^
a.cc:27:1: error: expected unqualified-id before 'else'
   27 | else
      | ^~~~
a.cc:28:17: error: expected declaration before '}' token
   28 | cout<<L-N<<endl;}
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
int64_t MOD=1000000007;

vector<pair<int,int>> CU(vector<int> S){
  vector<pair<int,int>> SS;
  sort(S.begin(),S.end());
  int temp=S.at(0);
  SS.push_back(make_pair(1,temp));
  for(int i=1;i<(int)S.size();i++){
    int s=S.size();
    temp=S.at(i);
    if(S.at(i)==S.at(i-1)) SS.at(s-1).first++;
    else SS.push_back(make_pair(1,temp));
  }
  sort(SS.begin(),SS.end());
  reverse(SS.begin(),SS.end());
  return SS
}


int main() {
  int N,o,e;
  e=N/2;
  o=(N+1)/2;
  vector<int> O(o);
  vector<int> E(e);
  for(int i=0;i<e;i++){
    cin>>O.at(i)>>E.at(i);
  }
  if(o!=e)cin>>o.at(o-1);
  vector<pair<int,int>> OO;
  vector<pair<int,int>> EE;
  OO=CU(O);
  EE=CU(E);
  if(OO.at(0).second!=EE.at(i).second) cout<< N-(OO.at(0).second+EE.at(0).second)<<endl;
  else cout<<N-max(OO.at(1).second+EE.at(0).second,OO.at(0).second+EE.at(1).second)<<endl;
}


Compiler output:
a.cc: In function 'std::vector<std::pair<int, int> > CU(std::vector<int>)':
a.cc:19:12: error: expected ';' before '}' token
   19 |   return SS
      |            ^
      |            ;
   20 | }
      | ~           
a.cc: In function 'int main()':
a.cc:32:18: error: request for member 'at' in 'o', which is of non-class type 'int'
   32 |   if(o!=e)cin>>o.at(o-1);
      |                  ^~
a.cc:37:29: error: 'i' was not declared in this scope
   37 |   if(OO.at(0).second!=EE.at(i).second) cout<< N-(OO.at(0).second+EE.at(0).second)<<endl;
      |                             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
int64_t MOD=1000000007;

vector<pair<int,int>> CU(vector<int> S){
  vector<pair<int,int>> SS;
  sort(S.begin(),S.end());
  int temp=S.at(0);
  SS.push_back(1,temp);
  for(int i=1;i<(int)S.size();i++){
    int s=S.size();
    temp=S.at(i);
    if(S.at(i)==S.at(i-1)) SS.at(s-1).first++;
    else SS.push_back(make_pair(1,temp));
  }
  sort(SS.begin(),SS.end());
  reverse(SS.begin(),SS.end());
  return SS
}


int main() {
  int N,o,e;
  e=N/2;
  o=(N+1)/2;
  vector<int> O(o);
  vector<int> E(e);
  for(int i=0;i<e;i++){
    cin>>O.at(i)>>E.at(i);
  }
  if(o!=e)cin>>o.at(o-1);
  vector<pair<int,int>> OO;
  vector<pair<int,int>> EE;
  OO=CU(O);
  EE=CU(E);
  if(OO.at(0).second!=EE.at(i).second) cout<< N-(OO.at(0).second+EE.at(0).second)<<endl;
  else cout<<N-max(OO.at(1).second+EE.at(0).second,OO.at(0).second+EE.at(1).second)<<endl;
}


Compiler output:
a.cc: In function 'std::vector<std::pair<int, int> > CU(std::vector<int>)':
a.cc:10:15: error: no matching function for call to 'std::vector<std::pair<int, int> >::push_back(int, int&)'
   10 |   SS.push_back(1,temp);
      |   ~~~~~~~~~~~~^~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; value_type = std::pair<int, int>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; value_type = std::pair<int, int>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note:   candidate expects 1 argument, 2 provided
a.cc:19:12: error: expected ';' before '}' token
   19 |   return SS
      |            ^
      |            ;
   20 | }
      | ~           
a.cc: In function 'int main()':
a.cc:32:18: error: request for member 'at' in 'o', which is of non-class type 'int'
   32 |   if(o!=e)cin>>o.at(o-1);
      |                  ^~
a.cc:37:29: error: 'i' was not declared in this scope
   37 |   if(OO.at(0).second!=EE.at(i).second) cout<< N-(OO.at(0).second+EE.at(0).second)<<endl;
      |                             ^