criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a = new int[n / 2];
        int[] b = new int[n / 2]; 
        for (int i = 0; i < n /2; i++) {
            a[i] = sc.nextInt();
            b[i] = sc.nextInt();
        }
        Arrays.sort(a);
        Arrays.sort(b);
        int aMaxcount = 1;
        int aSecondCount = 1;
        int amaxnum = 0;
        int amaxNum2 = 0;
        int acount = 1;
        for (int i = 0; i < n / 2 - 1; i++) {
            if (a[i] == a[i + 1]) {
                acount++;
                if (acount > aMaxcount) {
                    aMaxcount = acount;
                    amaxnum = i;
                }

            } else {
                acount = 1;
            }
        }
        for (int i = 0; i < n / 2 - 1; i++) {
            if (a[i] == a[amaxnum]) {
                acount = 1;
                break;
            }
            if (a[i] == a[i + 1]) {
                acount++;
                if (acount > aSecondCount) {
                    aSecondCount = acount;
                    amaxnum = i;
                }

            } else {
                acount = 1;
            }

        }

        int bMaxcount = 1;
        int bSecondCount = 1;
        int bmaxnum = 0;
        int bmaxNum2 = 0;
        int bcount = 1;
        for (int i = 0; i < n / 2 - 1; i++) {
            if (b[i] == b[i + 1]) {
                bcount++;
                if (bcount > bMaxcount) {
                    bMaxcount = bcount;
                    bmaxnum = i;
                }

            } else {
                bcount = 1;
            }
        }
        for (int i = 0; i < n / 2 - 1; i++) {
            if (b[i] == b[amaxnum]) {
                bcount = 1;
                break;
            }
            if (a[i] == a[i + 1]) {
                bcount++;
                if (bcount > bSecondCount) {
                    bSecondCount = bcount;
                    bmaxnum = i;
                }

            } else {
                bcount = 1;
            }

        }
        int ans = 0;
        if (a[amaxnum] != b[bmaxnum]) {
            ans = n - aMaxcount - bMaxcount;
        } else if(aMaxcount == n / 2){
            ans = n / 2;
        }else{
            int a = n - aMaxcount - bSecondCount;
            int b = n - aSecondCount - bMaxcount;
            ans = Math.max(a, b);
        }
        System.out.println(ans);
        
    }
}

Compiler output:
Main.java:91: error: variable a is already defined in method main(String[])
            int a = n - aMaxcount - bSecondCount;
                ^
Main.java:92: error: variable b is already defined in method main(String[])
            int b = n - aSecondCount - bMaxcount;
                ^
2 errors
Language: C++

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

#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define RFOR(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define LL long long
#define INF INT_MAX/3

const double EPS = 1e-14;
const double PI  = acos(-1.0);


typedef pair<int, int> p;

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

  vector<int> odd(n / 2);
  vector<int> even(n / 2);

  REP (i, n) {
    if (i % 2 == 0)
      scanf("%d", &even[i / 2]);
    else
      scanf("%d", &odd[i / 2]);
  }

  vector<p> e_num(100010);

  REP (i, 100010) {
    o_num[i] = make_pair(0, i);
    e_num[i] = make_pair(0, i);
  }

  REP (i, n / 2) {
    o_num[odd[i]].first++;
    e_num[even[i]].first++;
  }

  sort(o_num.begin(), o_num.end(), greater<p>());
  sort(e_num.begin(), e_num.end(), greater<p>());

  if (o_num[0].first != e_num[0].first && o_num[0].second != e_num[0].second) {
    printf("%d\n", ((n / 2) - o_num[0].first) + ((n / 2) - e_num[0].first));
  } else if (o_num[0].first == e_num[0].first && o_num[0].second != e_num[0].second) {
    printf("%d\n", ((n / 2) - o_num[0].first) + ((n / 2) - e_num[0].first));
  } else if (o_num[0].first <= e_num[0].first && o_num[0].second == e_num[0].second) {
    printf("%d\n", ((n / 2) - o_num[1].first) + ((n / 2) - e_num[0].first));
  } else if (o_num[0].first > e_num[0].first && o_num[0].second == e_num[0].second) {
    printf("%d\n", ((n / 2) - o_num[0].first) + ((n / 2) - e_num[1].first));
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:5: error: 'o_num' was not declared in this scope; did you mean 'e_num'?
   34 |     o_num[i] = make_pair(0, i);
      |     ^~~~~
      |     e_num
a.cc:39:5: error: 'o_num' was not declared in this scope; did you mean 'e_num'?
   39 |     o_num[odd[i]].first++;
      |     ^~~~~
      |     e_num
a.cc:43:8: error: 'o_num' was not declared in this scope; did you mean 'e_num'?
   43 |   sort(o_num.begin(), o_num.end(), greater<p>());
      |        ^~~~~
      |        e_num
Language: C++

#include<bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define lli long long int
using namespace std;

int main()
{
//fastio;
int n;
cin>>n;
int k=100000;
n=n/2;
int a[n],b[n];
for(int i=0;i<n;i++)
cin>>a[i]>>b[i];
int count = 0, curr_cnt = 1, freq_num = 0, key = 0;
for(int i = 0; i < n-1; i++)
{
    key = a[i];
    for(int j =i+1; j < n; j++)
    {
        if(key == a[j] && freq_num != key)
        {
            curr_cnt++;
        }
    }
    if(count < curr_cnt)
    {
        count = curr_cnt;
        curr_cnt = 1;
        freq_num = key;
    }
}
int c=freq_num;
int d=count;
count = 0, curr_cnt = 1, freq_num = 0, key = 0;
for(int i = 0; i < n-1; i++)
{
    key = b[i];
    for(int j =i+1; j < n; j++)
    {
        if(key == b[j] && freq_num != key)
        {
            curr_cnt++;
        }
    }
    if(count < curr_cnt)
    {
        count = curr_cnt;
        curr_cnt = 1;
        freq_num = key;
    }
}
int e=freq_num;
int f=count;
int g;
g=n+n-d-f;
if(c==e)
cout<<2*n;
else
cout<<g;


Compiler output:
a.cc: In function 'int main()':
a.cc:61:9: error: expected '}' at end of input
   61 | cout<<g;
      |         ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

#include<iostream>
#include<vector>
#include<utility>
#include<queue>
#include<string>
#include<cmath>
#include<tuple>
#include <algorithm>
#define INF 1111111111
using namespace std;
typedef pair<int,int> P;
typedef tuple<int,int,int> tup;
typedef long long ll;
vector<int> vec(100100);
vector<int> passed(100100);
vector<int> dx = {-1,1};
int n,k;

int main() {
  cin >> n ;
  int  a[100100]={0};
  int  b[100100]={0};
  for(int i=0;i<n;i++){
    cin >> k;
    if(i%2==0)
    a[k]++;
    else
    b[k]++;
  }
  int amax = 0,bmax = 0,bmaxsec=0;
  int numa=0,numb=0;
  for(int i=0;i<100100;i++){
   if(a[i]>amax){
     amax = a[i];
     numa = i;
   }
   if(b[i]=>bmax){
     bmaxsec = bmax;
     bmax = b[i];
     numb = i;
   }
  }
  if(numa != numb)
  cout << n-amax-bmax << endl;
  else
    cout << n-amax-bmaxsec << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:12: error: expected primary-expression before '>' token
   37 |    if(b[i]=>bmax){
      |            ^
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <cmath>

using namespace std;

#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))
// #define SIZE_OF_ARRAY(pro2) (sizeof(pro2)/sizeof(pro2[0]))

int main(){
    int n;
    int ans = 0;
    cin >> n;
    int pro[n];
    int pro1[n/2]; //偶数番目
    int pro2[n/2]; //奇数番目
    for(int i=0;i<n;i++){
        cin >> pro[i];
    }

    for(int i=0;i<n/2;i++){
        pro1[i] = pro[2 * i];
        pro2[i] = pro[2 * i + 1];
    }


    sort(pro1, pro1 + SIZE_OF_ARRAY(pro1));
    sort(pro2, pro2 + SIZE_OF_ARRAY(pro2));

    /* 同じ要素をカウントする */

    int now1 = 1;
    int now2 = 1;
    int max1 = 1;
    int max2 = 1;
    int maxnum1,maxnum2;

    for(int i=0;i<n/2-1;i++){
        if(pro1[i] == pro1[i+1]){
            now1++;
            if(now1 >= max1){
                max1 = now1;
                maxnum1 = pro1[i];
            }
        }
        else{
            now1 = 1;
        }

        if(pro2[i] == pro2[i+1]){
            now2++;
            if(now2 >= max2){
                max2 = now2;
                maxnum2 = pro2[i];
            }
        }
        else{
            now2 = 1;
        }
    }
    if(maxnum1 != maxnum2){
        ans = (n/2 - max1) + (n/2 - max2);
    }
    else{
        ans = n/2;
    }

    // printf("max1:%d  max2:%d\n",max1, max2);

    printf("%d",ans);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   29 |     sort(pro1, pro1 + SIZE_OF_ARRAY(pro1));
      |     ^~~~
      |     sqrt
Language: C++

// Devarshi

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

#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define ll long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i,n) for(i=0;i<n;i++)
#define forn(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define for1(i, n) for (ll i = 1; i <= (ll)(n); ++i)
#define ford(i, n) for (ll i = (ll)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define fora(it,x) for(auto it:x)
#define PI 3.14159265
#define sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;

template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }

const int maxn=1000001;

bool cmp(pii a,pii b){
    return a.se>b.se;
}

int main(){

sync

/*
#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
#endif
/*
    int n;
    cin>>n;
    int a[n];
    map<int,int> m;
    forn(i,n) cin>>a[i], m[a[i]]++;
    if(m.size()==1){
         cout<<n/2;
        return 0;
    }
    m.clear();
    map<int,int> m1;
    int tot1,tot2=n/2;
    if(n%2) tot1=n/2+1;
    else tot1=n/2;
    for(int i=0;i<n;i+=2){
        m[a[i]]++;
    }
    for(int i=1;i<n;i+=2){
        m1[a[i]]++;
    }
    int a1=0,b=0;
    int d1,d2;
    vpi v1,v2;
    for(auto it: m){
        v1.pb(mp(it.fi,it.se));
        if(a1<it.se){
            d1=it.fi;
        }
        a1=max(a1,it.se);
    }
    for(auto it:m1){
        v2.pb(mp(it.fi,it.se));
        if(b<it.se){
            d2=it.fi;
        }
        b=max(b,it.se);
    }
    sort(all(v1),cmp);
    sort(all(v2),cmp);
    //cout<<a<<" "<<b<<endl;
   // cout<<a1<<" "<<b<<endl;
   // cout<<d1<<endl<<d2<<endl;
    if(d1!=d2)
    cout<<tot1-a1+tot2-b;
    else{
        cout<<1<<endl;
        int ans1=tot1-a1+tot2-v2[1].se,ans2=tot1-v1[1].se+tot2-b;
        cout<<min(ans1,ans2);
    }
return 0;
}


Compiler output:
a.cc:46:1: error: unterminated comment
   46 | /*
      | ^
a.cc: In function 'int main()':
a.cc:21:71: error: expected '}' at end of input
   21 | #define sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
      |                                                                       ^
a.cc:44:1: note: in expansion of macro 'sync'
   44 | sync
      | ^~~~
a.cc:42:11: note: to match this '{'
   42 | int main(){
      |           ^
Language: C++

from collections import defaultdict
n = int(input())
v = list(map(int, input().split()))

d = defaultdict(int)
rd = defaultdict(int)
d[0] = 0
rd[0] = 0

ll = (n + 1) // 2
rr = (n) // 2

for i in range(0, n, 2):
    d[ v[i] ] = d[v [i] ] + 1
    if i + 1 < n:
        rd[ v[i+1]  ] = rd[ v[i+1] ] + 1

d = sorted(d.items(), key=lambda x: -x[1])
rd= sorted(rd.items(), key=lambda x: -x[1])


i , j = 0, 0

while d[i][0] == rd[j][0] and i < len(d) and j < len(rd):
    if (ll - d[i][1] < rr - rd[j][1]):
        i += 1
    else:
        j += 1

print(ll - d[i][1] + rr - rd[j][1])


Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from collections import defaultdict
      | ^~~~
Language: C++

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

int n;
int v[100010];
int c[2][100010];
int vmax[2];
int index[2];
int cmax[2];

int main()
{
	cin >> n;
	for (int i = 0; i < n; ++i) {
		cin >> v[i];
	}

	for (int i = 0; i < n; ++i) {
		c[i & 1][v[i]]++;
		vmax[i & 1] = max(vmax[i & 1], v[i]);
	}

	for (int i = 0; i < 2; ++i) {
		auto it = max_element(c[i], c[i] + vmax[i] + 1);
		index[i] = distance(c[i], it);
		cmax[i] = *it;
	}

	int ans = 0;

	if (index[0] == index[1]) {
		int index2[2] = {};
		int cmax2[2] = {};

		for (int i = 0; i < 2; ++i) {
			c[i][index[i]] = 0;
			auto it = max_element(c[i], c[i] + vmax[i] + 1);
			index2[i] = distance(c[i], it);
			cmax2[i] = *it;
		}

		int a[2] = {};
		a[0] += (n + 1) / 2 - cmax2[0];
		a[0] += n / 2 - cmax[1];
		a[1] += (n + 1) / 2 - cmax[0];
		a[1] += n / 2 - cmax2[1];
		ans = min(a[0], a[1]);
	}
	else {
		ans += (n + 1) / 2 - cmax[0];
		ans += n / 2 - cmax[1];
	}

	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc:8:12: error: 'int index [2]' redeclared as different kind of entity
    8 | int index[2];
      |            ^
In file included from /usr/include/string.h:462,
                 from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, int)'
   50 | extern const char *index (const char *__s, int __c)
      |                    ^~~~~
a.cc: In function 'int main()':
a.cc:25:22: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   25 |                 index[i] = distance(c[i], it);
      |                      ^
a.cc:31:18: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   31 |         if (index[0] == index[1]) {
      |                  ^
a.cc:31:30: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   31 |         if (index[0] == index[1]) {
      |                              ^
a.cc:36:35: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   36 |                         c[i][index[i]] = 0;
      |                                   ^
Language: C++

#include <iostream>
#include <string.h>
#include <utility>
using namespace std;

int main () {
  int n;
  cin >> n;
  int a[n];
  pair<int, int> ev[100000];
  pair<int, int> ov[100000];
  for (int i = 0; i < 100000; i++) {
    ev[i].first = 0;
    ev[i].second = i;
    ov[i].first = 0;
    ov[i].second = i;
  }
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (i % 2 == 0) {
      ev[a[i] - 1].first++;  
    }  
    else {
      ov[a[i] - 1].first++;  
    }
  }
  sort(ev, ev + 100000);
  sort(ov, ov + 100000);
  if (ev[99999].second != ov[99999].second) {
    cout << n / 2 - ev[99999].first + n / 2 - ov[99999].first << endl;  
  }
  else {
    if (ev[99998].first >= ov[99998].first) {
      cout << n / 2 - ov[99999].first + n / 2 - ev[99998].first << endl;  
    } 
    else {
      cout << n / 2 - ev[99999].first + n / 2 - ov[99998].first << endl;  
    }
  }
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   27 |   sort(ev, ev + 100000);
      |   ^~~~
      |   short
Language: C++

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

#define FOR(i,a,b) for(i=(a);i<(b);++i) 
#define FORR(i,a,b) for(i=(a);i>(b);--i)
#define REP(i,n) for(i=0;i<(n);++i)
#define REPR(i,n) for(i=(n);i>0;--i)
#define PB push_back
#define ll long long
#define INT_MAX 2147483647
#define LL_MAX 9223372036854775807

using namespace std;

long long GCD(long long a, long long b) {
	if (a < b)
		swap(a, b);
	if (b == 0) return a;
	else return GCD(b, a % b);
}
bool sosuu_check(int num) {
	int i;
	for (i = 2; i <= sqrt(num); ++i) {
		if (num%i == 0)
			return false;
	}
	return (num < 2) ? false : true;
}
int main() {
	int N,a,b,i,amax=0,bmax=0,anum,bnum,amax2,bmax2;
	cin >> N;
	vector<int> odd(100000), even(100000);
	REP(i, N/2) {
		cin >> a >> b;
		odd[a]++; even[b]++;
	}
	REP(i, 100000) {
		if (amax < odd[i]) {
			amax2 = amax;
			amax = odd[i];
			anum = i;
		}
		if (bmax < even[i]) {
			bmax2 = bmax;
			bmax = even[i];
			bnum = i;
		}
	}
	if (anum != bnum) {
		cout << (N / 2 - amax) + (N / 2 - bmax) << endl;
	}
	else {
		cout << min((N / 2 - amax2) + (N / 2 - bmax2),min((N / 2 - amax2) + (N / 2 - bmax), (N / 2 - amax) + (N / 2 - bmax2)) << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:135: error: invalid operands of types 'const int' and '<unresolved overloaded function type>' to binary 'operator<<'
   57 |                 cout << min((N / 2 - amax2) + (N / 2 - bmax2),min((N / 2 - amax2) + (N / 2 - bmax), (N / 2 - amax) + (N / 2 - bmax2)) << endl;
      |                                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
Language: C++

#include <iostream>
#include<algorithm>
#include <vector>
#include<string>
#include<cmath>
#include<cstdio>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define max(x,y) (((x)>(y)) ? x:y)
#define min(x,y) (((x)<(y)) ? x:y)
#define FOR(a,b,c) for(b=(c);b<(a);b++)
#define ender {return 0;}
#define tosasuretu(a) (a*(a+1)/2)
inline ll kaizyo(ll);
ll gcd(ll, ll);
ll combination(ll, ll);
int main() {
	int n;
	int in;
	vector<int> ki, guu;
	cin >> n;
	n /= 2;
	for (int i = 0; i < n; i++) {
		cin >> in;
		ki.push_back(in);
		cin >> in;
		guu.push_back(in);
	}
	sort(ki.begin(), ki.end());
	sort(guu.begin(), guu.end());
	int lastki = 0, lastguu = 0, maxki = 0, maxguu = 0, kicount = 0, gucount = 0, secondmaxki = 0, secondmaxguu = 0;
	for (int i = 0; i < ki.size; i++) {
		if (lastki != ki[i]) {
			maxki = max(kicount, maxki);
			kicount = 0;
		}
		if (lastguu != guu[i]) {
			maxguu = max(gucount, maxguu);
			gucount = 0;
		}
		kicount++;
		gucount++;
	}
	maxki = max(kicount, maxki);
	maxguu = max(gucount, maxguu);
	cout << (ki.size() - maxki) + (guu.size() - maxguu);
	return 0;
}


inline ll kaizyo(ll x) {
	long ans = 1;
	for (int z = 0; z < x; z++) {
		ans *= (x - z);
	}
	return ans;
}
ll gcd(ll a, ll b) {
	if (b == 0)return a;
	return gcd(b, a%b);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:32: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]' (did you forget the '()' ?)
   33 |         for (int i = 0; i < ki.size; i++) {
      |                             ~~~^~~~
      |                                    ()
Language: C++

import collections

n = int(input())

a = [int(l) for l in input().split()]

ac = collections.Counter(a[::2]).most_common()
bc = collections.Counter(a[1::2]).most_common()


while True:
    if len(ac) == 0:
        print(n-bc[0][1])
        break
    elif len(bc) == 0:
        print(n-ac[0][1])
        break
            
    if ac[0][0] != bc[0][0]:
        print(n-ac[0][1]-bc[0][1])
        break
    elif ac[0][1] >= bc[0][0]:
        bc.pop()
        continue
    else:
        ac.pop()
        continue







Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import collections
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<iostream>
#include<vector>
#include<conio.h>
using namespace std;

int main() {
	int n, count;
	count = 0;
	int same = 1;
	cin >> n;
	vector<int> v(n);
	for (int i = 0; i < n; i++) {
		cin >> v[i];
	}
	for (int i = 1; i < n-1; i += 2) {
		if (v[i - 1] != v[i + 1]) {
			v[i + 1] = v[i - 1];
			count++;
		}
	}
	for (int i = 2; i < n-1; i += 2) {
		if (v[i - 1] != v[i + 1]) {
			v[i + 1] = v[i - 1];
			count++;
		}
	}
	for (int i = 1; i < n; i++) {
		if (v[i - 1] == v[i]) {
			same++;
		}
	}
	if (same == n) {
		count = n / 2;
	}
	cout << count << endl;
}

Compiler output:
a.cc:3:9: fatal error: conio.h: No such file or directory
    3 | #include<conio.h>
      |         ^~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
int ganjil[1000010];
int genap[1000010];
vector <int> gan
vector <int> num;
int main()
{
	int n;
	cin>>n;
	int x;
	int pos_genap,pos_ganjil;
	int mx_genap=0,mx_ganjil=0;
	for(x=1;x<=n;x++)
	{
		int a;
		cin>>a;
		if(x%2==0)
		{
			genap[a]++;
		}
		else
		{
			ganjil[a]++;
		}
		if(mx_genap<genap[a])
		{
			mx_genap=genap[a];
			pos_genap=a;
		}
		if(mx_ganjil<ganjil[a])
		{
			mx_ganjil=ganjil[a];
			pos_ganjil=a;
		}
	}
	if(pos_ganjil==pos_genap)
	{
		int plus=n%2;
		if(n/2-mx_genap>n/2+plus-mx_ganjil)
		{
			int x;
			mx_genap=0;
			for(x=1;x<=10000010;x++)
			{
				if(x%2==0)
				{
				if(genap[x]>mx_genap&&pos_genap!=num[x])
				{
					mx_genap=genap[x];
				}
				}
			}
		}
		else
		{
			int x;
			mx_ganjil=0;
			for(x=1;x<=10000009;x+=2)
			{
				if(x%2==1)
				{
				if(ganjil[x]>mx_ganjil&&pos_ganjil!=num[x])
				{
					mx_ganjil=ganjil[x];
				}
				}
			}
		}
	}
	cout<<n/2-mx_genap+n/2+(n%2)-mx_ganjil<<endl;
}

Compiler output:
a.cc:6:1: error: expected initializer before 'vector'
    6 | vector <int> num;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:48:66: error: 'num' was not declared in this scope; did you mean 'enum'?
   48 |                                 if(genap[x]>mx_genap&&pos_genap!=num[x])
      |                                                                  ^~~
      |                                                                  enum
a.cc:63:69: error: 'num' was not declared in this scope; did you mean 'enum'?
   63 |                                 if(ganjil[x]>mx_ganjil&&pos_ganjil!=num[x])
      |                                                                     ^~~
      |                                                                     enum
Language: C++

#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[])
{
	int d;
	scanf("%d",&d);
	int a[100005],b[100005];
	memset(a,0,sizeof(a));
	memset(b,0,sizeof(b));
	int t;
	int maxa=0,maxb=0;
	int sea=0,seb=0;
	for(int i=0;i<d;i++)
	{
		if(i%2==0)
		{
			scanf("%d",&t);
			a[t]++;
			if(a[t]>=a[maxa])
			{
				if(t!=maxa)
				{
				sea=maxa;
				maxa=t;
				}
			}
		}
		else
		{
			scanf("%d",&t);
			b[t]++;
			if(b[t]>=b[maxb])
			{
				if(t!=maxb)
				{
				seb=maxb;
				maxb=t;
				}
			}
		}
	}
	if(maxa==maxb)
	{
		if(t[sea]>=t[seb])maxa=sea;
		else maxb=seb;
	}
	printf("%d",d-a[maxa]-b[maxb]);
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:44:21: error: invalid types 'int[int]' for array subscript
   44 |                 if(t[sea]>=t[seb])maxa=sea;
      |                     ^
a.cc:44:29: error: invalid types 'int[int]' for array subscript
   44 |                 if(t[sea]>=t[seb])maxa=sea;
      |                             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int cnt1[100003],cnt2[100003],n,x,mx1,mx2,x1,x2;
int main(){
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>x;
		if(i%2==0)
		{
			cnt1[x]++,
			if(mx1<cnt1[x])
				mx1=cnt1[x],
				x1=x;
		}
		else
		{
			cnt2[x]++,
			if(mx2<cnt2[x])
				mx2=cnt2[x],
				x2=x;
		}
	}
	sort(cnt1,cnt1+100003);
	sort(cnt2,cnt2+100003);
	if(x1!=x2)
		cout<<n-mx1-mx2;
	else
		cout<<n-max(mx1+cnt2[100001],mx2+cnt1[100001]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:25: error: expected primary-expression before 'if'
   12 |                         if(mx1<cnt1[x])
      |                         ^~
a.cc:19:25: error: expected primary-expression before 'if'
   19 |                         if(mx2<cnt2[x])
      |                         ^~
Language: C++

#include <bits/stdc++.h>
#define INT INT_MAX
#define LONG LLONG_MAX
#define f(i,n) for(int i=0;i<(n);i++)
#define P pair<int,int>
#define int long long
typedef long long ll;
using namespace std;

ll GCD(ll a, ll b) {
	if (b == 0)return a;
	return GCD(b, a%b);
}

ll LCM(ll a, ll b) {
	return a / GCD(a, b)*b;
}

ll mypow(ll a, ll b, ll c) {
	if (b == 0)return 1;
	if (b % 2)return mypow(a, b - 1, c)*a%c;
	else return mypow(a, b / 2, c)*mypow(a, b / 2, c) % c;
}

ll longmax(ll a,ll b){
	if(a>b) return a;
	else return b;
}

ll longmin(ll a,ll b){
	if(a<b) return a;
	else return b;
}

map<int,int> m;

signed main(){
	int a,x[100000],ans=0,z=0;
	cin>>a;
	f(i,a){
		cin>>x[i];
	}
	for(int i=0;i<a;i+=2){
		m[x[i]]++;
		z=max(z,m[x[i]);
	} 
	ans+=(a+1)/2-z;
	m={};
	z=0;
	for(int i=1;i<a;i+=2){
		m[x[i]]++;
		z=max(z,m[x[i]]);
	}
	ans+=a/2-z;
	cout<<ans<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:31: error: expected ']' before ')' token
   45 |                 z=max(z,m[x[i]);
      |                               ^
      |                               ]
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define N 1010
int x[N],y[N],d[N],vis[2];
inline int read() {
    int x=0,f=1;
    char ch=getchar();
    while (!isdigit(ch)) {
        if (ch=='-') f=-1;
        ch=getchar();
    }
    while (isdigit(ch)) x=x*10+ch-'0',ch=getchar();
    return x*f;
}
int main() {
    int n=read(),m=0;
    for (int i=1;i<=n;i++) {
        x[i]=read(),y[i]=read();
        vis[(x[i]+y[i])&1]=true;
    }
	if (vis[0]&vis[1]) return puts("-1")&0;
	if (vis[0]) d[++m]=1;
	for (int i=30;i>=0;i--) d[++m]=1<<i;
	printf("%d\n",m);
	for (int i=1;i<=m;i++) printf("%d ",d[i]); putchar('\n');
	for (int i=1;i<=n;i++) {
		for (int j=1;j<=m;j++) {
			if (abs(x[i])>abs(y[i])) {
				if (x[i]>0) x[i]-=d[j],putchar('R');
				else x[i]+=d[j],putchar('L');
			} else {
				if (y[i]>0) y[i]-=d[j],putchar('U');
				else y[i]+=d[j],putchar('D');
			}
		}
		putchar('\n')
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:30: error: expected ';' before '}' token
   36 |                 putchar('\n')
      |                              ^
      |                              ;
   37 |         }
      |         ~
Language: C++

#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;
typedef long long LL;
int _min(int x, int y) {return x < y ? x : y;}
int _max(int x, int y) {return x > y ? x : y;}

struct node {
	int x, y;
} a[1100];
char ans[1100][41];
int n, now, D[40];

void solve(int x) {
	++now; D[now] = x;
	for(int i = 1; i <= n; i++) {
		if(abs(a[i].x) > abs(a[i].y)) {
			if(a[i].x > 0) ans[i][now] = 'R', a[i].x -= x; 
			else ans[i][now] = 'L', a[i].x += x;
		} else {
			if(a[i].y > 0) ans[i][now] = 'U', a[i].y -= x;
			else ans[i][now] = 'D', a[i].y += x;
		}
	}
}

int main() {
	cin>>n;
	for(int i = 1; i <= n; i++) cin>>a[i].x , cin>>a[i].y ;
	for(int i = 30; i >= 0; i--) solve(1 << i);
	if(a[1].x || a[1].y) solve(1);
	for(int i = 1; i <= n; i++) {
		if(a[i].x || a[i].y) {puts("-1"); return 0;}
	} printf("%d\n", now);
	for(int i = 1; i <= now; i++) printf("%d ", D[i]);
	printf("\n");
	for(int i = 1; i <= n; i++) printf("%s\n", ans[i] + 1);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:9: error: 'cin' was not declared in this scope
   30 |         cin>>n;
      |         ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include <algorithm>
  +++ |+#include <iostream>
    4 |
Language: C++

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

int main() {
	long long N, X[1000], Y[1000];
	cin >> N;
	for (int i = 0; i < N; i++) cin >> X[i] >> Y[i];
	for (int i = 0; i < N - 1; i++) {
		if (abs(X[i] + Y[i]) % 2 != abs(X[i + 1] + Y[i + 1]) % 2) {
			cout << -1 << endl;
			return 0;
		}
	}
	if (abs(X[0] + Y[0]) % 2 == 0) {
		cout << 32 << endl << 1;
		for (int i = 0; i < 31; i++) {
			cout << " " << (1 << i);
		}
		cout << endl;
	}
	else {
		cout << 31 << endl;
		for (int i = 0; i < 31; i++) {
			cout << (1 << i);
			if (i == 30) cout << endl;
			else cout << " ";
		}
	}
	for (int i = 0; i < N; i++) {
		long long U = X[i] + Y[i], V = X[i] - Y[i];
		if (U % 2 == 0) {
			cout << 'L';
			U--, V--;
		}
		U = ((1LL << 32 - 1) - U) / 2, V = ((1LL << 32 - 1) - V) / 2;
		for (int i = 0; i < 31; i++) {
			long long UB = U % 2, VB = V % 2;
			U /= 2, V /= 2;
			if (UB == 0 && VB == 0) cout << 'R';
			if (UB == 0 && VB == 1) cout << 'U';
			if (UB == 1 && VB == 0) cout << 'D';
			if (UB == 1 && VB == 1) cout << 'L';
		}
		cout << endl;
	}


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

#include <iostream>
#include <string>
#include <vector>
#include <cassert>
#include <algorithm>
#include <functional>
#include <cmath>
#include <utility>
#include <numeric>
#include <map>
#include <iomanip>
using namespace std;

int mypow(int a, int b){
	if(b == 0) return 1;
	if(b == 1) return a;
	if(b == 2) return a * a;
	if(b % 2 == 0) return mypow(mypow(a, b / 2), 2);
	return a * mypow(a, b - 1);
}

char solve(long long uf, long long vf, long long &u, long long &v, int d){
	if(uf - u >= 0 && vf - v >= 0){
		u += d; v += d;
		return 'R';
	}
	if(uf - u >= 0 && vf - v <= 0){
		u += d; v -= d;
		return 'U';
	}
	if(uf - u <= 0 && vf - v >= 0){
		u -= d; v += d;
		return 'D';
	}
	if(uf - u <= 0 && vf - v <= 0){
		u -= d; v -= d;
		return 'L';
	}
}

int main() {

	int N; cin >> N;
	vector<pair<int, int>> xy(N);
	for(int i = 0; i < N; i++) cin >> xy[i].first >> xy[i].second;

	int flag = -1;
	bool possible = true;
	for(int i = 0; i < N; i++){
		if(flag == -1){
			flag = abs(xy[i].first + xy[i].second) % 2;
		}else if(flag != abs(xy[i].first + xy[i].second) % 2){
			possible = false;
			break;
		}
	}

	if(!possible){
		cout << -1 << endl;
		return 0;
	}

	vector<pair<long long, long long>> uv(N);
	for(int i = 0; i < N; i++){
		uv[i].first = xy[i].first + xy[i].second;
		uv[i].second = xy[i].first - xy[i].second;		
	}

	

	int arms = 31;

	if(flag == 1){
		cout << arms << endl;
	}else{
		cout << arms + 1 << endl;
	}

	for(int i = arms - 1; i >= 0; i--){
		cout << mypow(2, i) << " ";
	}
	if(flag == 0) cout << 1;
	cout << endl;

	for(int i = 0; i < N; i++){
		long long u = 0, v = 0, uf = uv[i].first, vf = uv[i].second;
		for(int i = arms - 1; i >= 0; i--){
			cout << solve(uf, vf, u, v, mypow(2, i));
		}
		if(flag == 0){
			cout << solve(uf, vf, u, v, 1);
		}
		cout << endl;
	}
		cout << u << " " << v << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:95:25: error: 'u' was not declared in this scope; did you mean 'uv'?
   95 |                 cout << u << " " << v << endl;
      |                         ^
      |                         uv
a.cc:95:37: error: 'v' was not declared in this scope; did you mean 'uv'?
   95 |                 cout << u << " " << v << endl;
      |                                     ^
      |                                     uv
a.cc: In function 'char solve(long long int, long long int, long long int&, long long int&, int)':
a.cc:39:1: warning: control reaches end of non-void function [-Wreturn-type]
   39 | }
      | ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <cassert>
#include <algorithm>
#include <functional>
#include <cmath>
#include <utility>
#include <numeric>
#include <map>
#include <iomanip>
using namespace std;

int mypow(int a, int b){
	if(b == 0) return 1;
	if(b == 1) return a;
	if(b == 2) return a * a;
	if(b % 2 == 0) return mypow(mypow(a, b / 2), 2);
	return a * mypow(a, b - 1);
}

char solve(long long uf, long long vf, long long &u, long long &v, int d){
	if(uf - u >= 0 && vf - v >= 0){
		u += d; v += d;
		return 'R';
	}
	if(uf - u >= 0 && vf - v <= 0){
		u += d; v -= d;
		return 'U';
	}
	if(uf - u <= 0 && vf - v >= 0){
		u -= d; v += d;
		return 'D';
	}
	if(uf - u <= 0 && vf - v <= 0){
		u -= d; v -= d;
		return 'L';
	}
}

int main() {

	int N; cin >> N;
	vector<pair<int, int>> xy(N);
	for(int i = 0; i < N; i++) cin >> xy[i].first >> xy[i].second;

	int flag = -1;
	bool possible = true;
	for(int i = 0; i < N; i++){
		if(flag == -1){
			flag = (xy[i].first + xy[i].second) % 2;
		}else if(flag != (xy[i].first + xy[i].second) % 2){
			possible = false;
			break;
		}
	}

	if(!possible){
		cout << -1 << endl;
		return 0;
	}

	vector<pair<long long, long long>> uv(N);
	for(int i = 0; i < N; i++){
		uv[i].first = xy[i].first + xy[i].second;
		uv[i].second = xy[i].first - xy[i].second;		
	}

	

	int arms = 31;

	if(flag == 1){
		cout << arms << endl;
	}else{
		cout << arms + 1 << endl;
	}

	for(int i = arms - 1; i >= 0; i--){
		cout << mypow(2, i) << " ";
	}
	if(flag == 0) cout << 1;
	cout << endl;

	for(int i = 0; i < N; i++){
		long long u = 0, v = 0, uf = uv[i].first, vf = uv[i].second;
		for(int i = arms - 1; i >= 0; i--){
			cout << solve(uf, vf, u, v, mypow(2, i));
		}
		if(flag == 0){
			cout << solve(uf, vf, u, v, 1);
		}
		cout << endl;
	}
		cout << u << " " << v << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:95:25: error: 'u' was not declared in this scope; did you mean 'uv'?
   95 |                 cout << u << " " << v << endl;
      |                         ^
      |                         uv
a.cc:95:37: error: 'v' was not declared in this scope; did you mean 'uv'?
   95 |                 cout << u << " " << v << endl;
      |                                     ^
      |                                     uv
a.cc: In function 'char solve(long long int, long long int, long long int&, long long int&, int)':
a.cc:39:1: warning: control reaches end of non-void function [-Wreturn-type]
   39 | }
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <stack>
#include <complex>
#include <stdlib.h>
#include <stdio.h>
#include <functional>
#include <cfloat>

#define Sort(a) sort(a.begin(), a.end())
#define Reverse(a) reverse(a.begin(), a.end())

#define fs first
#define sc second

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

int main()
{
  ll N;

  cin >> N;

  P arr[N];

  ll parity;
  for (int i = 0; i < N; i++)
  {
    ll a, b;
    cin >> a >> b;
    arr[i] = P(a, b);
    if (i == 0)
    {
      parity = abs((a + b) % 2);
    }
    else
    {
      if(parity != abs((a + b)%2))
      {
        cout << -1 << endl;
        return 0;
      }
    }
  }

  ll narm = 39
  if(parity == 0)
  {
    cout << narm + 1 << endl;
    cout << 1 << " ";
  }
  else 
    cout << narm << endl;

  for (ll j = narm-1; j >= 0; j--)
  {
    cout << (1LL << j);
    if(j > 0)
      cout << " ";
  }
  cout << endl;

  for (int i = 0; i < N; i++)
  {
    string ans;
    ll tmpx = arr[i].first;
    ll tmpy = arr[i].second;
    if(parity == 0)
     tmpx--;
    for (ll j = narm - 1; j >= 0; j--)
    {
      if (abs(tmpx) > abs(tmpy))
      {
        if(tmpx >= 0)
        {
          tmpx = tmpx - (1LL << j);
          ans += "R";
        }
        else
        {
          tmpx = (1LL << j) + tmpx;
          ans += "L";          
        }
      }
      else
      {
        if (tmpy >= 0)
        {
          tmpy = tmpy - (1LL << j);
          ans += "U";
        }
        else
        {
          tmpy = (1LL << j) + tmpy;
          ans += "D";
        }
      }
    } // j
    if(parity == 0)
      cout << "R";
    cout << ans << endl;
  } // i

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:3: error: expected ',' or ';' before 'if'
   58 |   if(parity == 0)
      |   ^~
a.cc:63:3: error: 'else' without a previous 'if'
   63 |   else
      |   ^~~~
Language: C++

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

pair<long long, long long> pos[200005];

long long main()
{
    long long n;
    cin >> n;
    for(long long i = 0; i < n; ++i){
        cin >> pos[i].first >> pos[i].second;
    }

    long long par = abs(pos[0].first + pos[0].second) % 2;
    for(long long i = 1; i < n; ++i){
        if(abs(pos[i].first + pos[i].second) % 2 != par){
            cout << "-1\n";
            return 0;
        }
    }

    vector<long long> d;
    for(long long i = 30; i >= 0; --i){
        d.push_back((1LL << i));
    }
    if(!par){
        d.push_back(1);
    }

    cout << (long long)d.size() << "\n";
    for(auto x : d){
        cout << x << " ";
    }
    cout << "\n";

    for(long long i = 0; i < n; ++i){
        long long xdir = 0, ydir = 0;
        long long xcur = 0, ycur = 0;
        for(long long j = 0; j < (long long)d.size();){
            xdir = 0;ydir = 0;
            if(xcur > pos[i].first){
                xdir = -1;
                xcur -= d[j];
                ++j;
            }else if(xcur < pos[i].first){
                xdir = 1;
                xcur += d[j];
                ++j;
            }
            if(ycur > pos[i].second){
                ydir = -1;
                ycur -= d[j];
                ++j;
            }else if(ycur < pos[i].second){
                ydir = 1;
                ycur += d[j];
                ++j;
            }

            if(xdir == -1){cout << "D";}
            if(xdir == 1){cout << "U";}
            if(ydir == -1){cout << "L";}
            if(ydir == 1){cout << "R";}
        }
        cout << "\n";
    }
    return 0;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

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

int main(){
  int n,x,y;
  int tmp;
  int maximum = 0;
  cin >> n;
  typedef pair<int,int> P;
  vector<P> coordinate(n) = {};
  for (int i = 0; i<n; i++){
    cin >> x >> y;
    maximum = max(maximum,abs(x)+abs(y));
    if (i==0) tmp = (abs(x) + abs(y))%2;
    else if (tmp != (abs(x) + abs(y))%2){
      cout << -1 << endl;
      exit(1);
    }
    coordinate.push_back({x,y});
  }
  //出力
  cout << maximum << endl;
  for (int i = 0; i< maximum-1; i++){
    cout << "1 ";
  }
  cout << "1" << endl;
  for (int i = 0; i<n; i++){
    if (coordinate[i].first >= 0){
      for (int j = 0; j<coordinate[i].first; j++){
        cout << "R";
      }
    }else{
      for (int j = 0; j>coordinate[i].first; j--){
        cout << "L";
      }
    }
    if (coordinate[i].second >= 0){
      for (int j = 0; j<coordinate[i].second; j++){
        cout << "U";
      }
    }else{
      for (int j = 0; j>coordinate[i].second; j++){
        cout << "D";
      }
    }
    for (int j = 0; j<maximum-abs(coordinate[i].first)-abs(coordinate[i].second); j+=2){
      cout << "LR";
    }
    cout << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:27: error: expected ',' or ';' before '=' token
   10 |   vector<P> coordinate(n) = {};
      |                           ^
Language: C++

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

ll x[1009], y[1009], rx[1009], ry[1009];

void rp(ll d, ll r)
{
	if (d == 0 && r == -1) cout << "R";
	else if (d == 0 && r == 1) cout << "L";
	else if (d == 1 && r == -1) cout << "U";
	else cout << "D";
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	int n; cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> x[i] >> y[i];
		rx[i] = ry[i] = 1;
		if (x[i] < 0) {
			x[i] *= -1; rx[i] = -1;
		}
		if (y[i] < 0) {
			y[i] *= -1; ry[i] = -1;
		}
	}
	ll t = (x[0] + y[0]) % 2;
	for (int i = 0; i < n; i++) {
		if ((x[i] + y[i]) % 2 != t) {
			cout << -1 << '\n';
			return 0;
		}
	}
	cout << 35 + t << '\n';
	ll mr = (1LL << 32LL);
	cout << mr << " ";
	if (t == 1) cout << 1 << " ";
	for (int i = 0; i <= 32; i++)
		cout << (1LL << (ll)i) << " ";
	cout << (1LL << 33LL) - 1LL;
	cout << '\n';
	for (int i = 0; i < n; i++) {
		y[i] += mr; rp(1, ry[i]);
		if (t == 1) {
			if (x[i] % 2 == 1) { x[i]--; rp(0, rx[i] * -1); }
			else { y[i]--; rp(1, ry[i] * -1); }
		}
		for (int j = 0; j <= 32; j++) {
			ll ti = (1LL << ll(j));
			bool f = false;
			if ((x[i] & (ti * 2)) != (y[i] & (ti * 2)))
				f = true;
			if ((x[i] & ti) != 0) {
				if (f) {
					x[i] += ti; rp(0, rx[i]);
				}
				else {
					x[i] -= ti; rp(0, rx[i] * -1);
				}
			}
			else {	
				if (f) {
					y[i] -= ti; rp(1, ry[i] * -1);
				}
				else {
					y[i] += ti; rp(1, ry[i]);
				}
			}
		}
		y[i] -= (1LL << 33LL) - 1LL; rp(1, ry[i] * -1);
		cout << '\n';
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:12: error: expected primary-expression before 'long'
    3 | #define ll long long
      |            ^~~~
a.cc:52:41: note: in expansion of macro 'll'
   52 |                         ll ti = (1LL << ll(j));
      |                                         ^~
a.cc:52:40: error: expected ')' before 'long'
   52 |                         ll ti = (1LL << ll(j));
      |                                 ~      ^
      |                                        )
Language: C++

#include <iostream>
using namespace std;

#define ll long long

ll abc (ll x) {
  if (x < 0) {
    return -1 * x;  
  }  
  return x;
}

int main () {
  ll n;
  cin >> n;
  bool ok = false;
  bool fail = false;
  ll x[n], y[n];
  for (ll i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
    if (i == 0 && x[i] % 2 == y[i] % 2) {
      ok = true;    
    }  
    if (ok && x[i] % 2 != y[i] % 2) {
      fail = true;    
    }
    if (!ok && x[i] % 2 == y[i] % 2) {
      fail = true;  
    }
  }  
  if (fail) {
    cout << "-1" << endl;  
    continue;
  }
  ll m;
  m = 39;
  if (ok) {
    m++;  
  }
  ll two[m];
  for (ll i = 0; i < m; i++) {
    if (i == 0) {
      two[m - i - 1] = 1;  
      cout << m << endl;
    }    
    else {
      if (i == 1 && m == 40) {
        two[m - i - 1] = 1;  
      }
      else {
        two[m - i - 1] = two[m - i] * 2;  
      }
    }
  }
  for (ll i = 0; i < m; i++) {
    if (i != m - 1) {
      cout << two[i] << " ";  
    }  
    else {
      cout << two[i] << endl;  
    }
  }
  for (ll i = 0; i < n; i++) {
    // x, yについて求める.
    for (ll j = 0; j < m; j++) {
      // まずx, yにどっちが大きいかを調べる
      if (abc(x[i]) > abc(y[i])) {
        if (x[i] > 0) {
          x[i] = x[i] - two[j];
          cout << "R";  
        }  
        else {
          x[i] = x[i] + two[j];  
          cout << "L";
        }
      } 
      else {
        if (y[i] > 0) {
          y[i] = y[i] - two[j];
          cout << "U";  
        }    
        else {
          y[i] = y[i] + two[j];
          cout << "D";  
        }
      }         
    }   
    cout << endl;
  }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:5: error: continue statement not within a loop
   33 |     continue;
      |     ^~~~~~~~
Language: C++

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

using namespace std;

typedef long long ll;

void solve(ll a, ll b, ll v[], int m) {
    for (int i = 0; i < m; i++) {
        if ( a > 0 ) {
            a += v[i];
            cout << "R";
        } else if ( a < 0 ) {
            a -= v[i];
            cout << "L";
        } else if ( b > 0 ) {
            b += v[i];
            cout << "U";
        } else if ( b < 0 ) {
            b -= v[i];
            cout << "D";
        } 
    }
    cout << endl;
    return;
}
/*
void debug(ll v[], int m) {
    int x = 0, y = 0;
    string s;
    cin >> s;

    for (int i = 0; i < s.length(); i++) {
        if (s[i] == 'R') {
            x += v[i];
        } else if (s[i] == 'L') {
            x -= v[i];
        } else if (s[i] == 'U') {
            y += v[i];
        } else {
            y -= v[i];
        }
        cout << x << " " << y << endl;
    }
}
*/
int main() {
    int N, m = 34;
    ll X[1003], Y[1003];
    ll d[34];
    ll  t = 1;
    for (int i = 0; i < 33; i++) {
        d[32-i] = t;
        t *= 2;
    }
    d[33] = 1;

    cin >> N;

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

    for (int i = 0; i < m; i++) {
        cout << d[i];
        if (i == m-1) { cout << endl; }
        else { cout << " "; }
    }

    for (int i = 0; i < N; i++) {
        solve(X[i], Y[i], d, m);
    }
    debug(d, m);

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:86:5: error: 'debug' was not declared in this scope
   86 |     debug(d, m);
      |     ^~~~~
Language: C++

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

using namespace std;

typedef long long ll;

void solve(ll a, ll b, ll v[], int m) {
    for (int i = 0; i < m; i++) {
        if ( a > 0 ) {
            a += v[i];
            cout << "R";
        } else if ( a < 0 ) {
            a -= v[i];
            cout << "L";
        } else if ( b > 0 ) {
            b += v[i];
            cout << "U";
        } else if ( b < 0 ) {
            b -= v[i];
            cout << "D"
        } 
    }
    cout << endl;
    return;
}
/*
void debug(ll v[], int m) {
    int x = 0, y = 0;
    string s;
    cin >> s;

    for (int i = 0; i < s.length(); i++) {
        if (s[i] == 'R') {
            x += v[i];
        } else if (s[i] == 'L') {
            x -= v[i];
        } else if (s[i] == 'U') {
            y += v[i];
        } else {
            y -= v[i];
        }
        cout << x << " " << y << endl;
    }
}
*/
int main() {
    int N, m = 34;
    ll X[1003], Y[1003];
    ll d[34];
    ll  t = 1;
    for (int i = 0; i < 33; i++) {
        d[32-i] = t;
        t *= 2;
    }
    d[33] = 1;

    cin >> N;

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

    for (int i = 0; i < m; i++) {
        cout << d[i];
        if (i == m-1) { cout << endl; }
        else { cout << " "; }
    }

    for (int i = 0; i < N; i++) {
        solve(X[i], Y[i], d, m);
    }
    debug(d, m);

    return 0;
}


Compiler output:
a.cc: In function 'void solve(ll, ll, ll*, int)':
a.cc:22:24: error: expected ';' before '}' token
   22 |             cout << "D"
      |                        ^
      |                        ;
   23 |         }
      |         ~               
a.cc: In function 'int main()':
a.cc:86:5: error: 'debug' was not declared in this scope
   86 |     debug(d, m);
      |     ^~~~~
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 ( ( abs(X[i]) + abs(Y[i])) % 2 == 0) {
            even++;
        } else {
            odd++;
        }
        if (abs(X[i]) > 10 || abs(Y[i]) > 10) {
            cout << -1 << endl;
            return 0;
        }
    }
    if (even && odd) {
        cout << -1 << endl;
        eturn 0;
    }

    if (even) { m = 22; }
    else { m = 21; }
    cout << m << endl;
    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 == 0) { cout << "RL"; }
        }
        cout << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: error: 'eturn' was not declared in this scope; did you mean 'extern'?
   27 |         eturn 0;
      |         ^~~~~
      |         extern