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

#include <iostream>

using namespace std;
int recur(int N, int *p)
{
  if(N==1)
  {cout<<p[N];
   return 0;}
  for(int i=1;i<=N;i++)
  {if((p[i+1]-p[i])>0)
    p[i]=p[i+1]-p[i];
   else
     p[i]=p[i]-p[i+1];
  }
  N--;
  return (recur(N,p));
  

int main()
{
    int i,N,j;
    int a[1000000];
    cin>>N;
    for(i=1;i<=N;i++)
    {
        cin>>a[i];
      recur(N,a);
      return 0;
    }
   

Compiler output:
a.cc: In function 'int recur(int, int*)':
a.cc:19:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   19 | int main()
      |         ^~
a.cc:19:9: note: remove parentheses to default-initialize a variable
   19 | int main()
      |         ^~
      |         --
a.cc:19:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:20:1: error: a function-definition is not allowed here before '{' token
   20 | {
      | ^
a.cc:29:6: error: expected '}' at end of input
   29 |     }
      |      ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<long long,long long>
#define mod 1000000007
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);

ll power(ll a,ll b){
	ll ans=1;
	while(b>0){
		if(b%2!=0){
			ans=(ans*a)%mod;
		}
		a=(a*a)%mod;
		b>>=1;
	}
	return ans;
}
int cnt=0;


int main() {
	IOS;
	int t=1;
	//cin>>t;
	while(t--){
		int n;
		cin>>n;
		string s;
		cin>>s;
		vector<int> v;
		for(int i=0;i<s.size();i++){
			v.push_back(s[i]-'0');
		}
		while(v.size()>2){
			vector<int> u;
			for(int i=0;i<v.size()-1;i++){
				int z=abs(v[i]-v[i+1]);
				if(z!=0)
				u.push_back(z);
			}
			v=u;
		}
      int an;
     	if(v.size()==0)
        ans=0;
     	else if(v.size()==1)
		an=v[0];
		else
		an=abs(v[0]-v[1]);
      	if(s[0]-'0'==1&&an==2){
        cout<<1;
        }
      else
        cout<<an;
	}
	return 0;
}


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

#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <chrono>
#include <climits>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;

template <class T1, class T2>
ostream& operator << (ostream& out, pair <T1, T2> p)
{
	out << '(' << p.first << ',' << p.second << ')';
	return out;
}

template <class T1, class T2>
istream& operator >> (istream& in, pair<T1, T2> &p)
{
	in >> p.first >> p.second;
	return in;
}

template <class T>
istream& operator >> (istream& in, vector<T> &v)
{
	for (T &x : v)
		in >> x;
	return in;
}

template <class T>
ostream& operator << (ostream& out, vector<vector<T>> &v)
{
	for (vector<T> &x : v)
		out << x << '\n';
	return out;
}

template <class T>
ostream& operator << (ostream& out, vector<T> &v)
{
	for (T &x : v)
		out << x << ' ';
	return out;
}

long long gcd (long long a, long long b)
{
	if (b > a)
		swap(a, b);
	return (b ? gcd(b, a % b) : a);
}

using ll   = long long;
using pii  = pair<int, int>;
using pll  = pair<long long, long long>;
using tiii = pair<pair<int, int>, int>;
using vi   = vector<int>;
using vl   = vector<long long>;
using vvi  = vector<vector<int>>;
using vvl  = vector<vector<long long>>;

#define F          first
#define S          second
#define First      first.first
#define Second     first.second
#define Third      second
#define mp         make_pair
#define rep(i,a,b) for (int i = a; i < b; i++)
#define per(i,b,a) for (int i = b; i > a; i--)
#define all(x)     x.begin(), x.end()
#define ret(x)     return cout << x, 0;
#define throwex    throw runtime_error ("Found the error.");

const int h = 1000000007;

signed main()
{
	ios::sync_with_stdio(false);
	#ifdef ONLINE_JUDGE
	cin.tie(nullptr);
	cout.tie(nullptr);
	cerr.setstate(ios::failbit);
	#endif

	int n;
	cin >> n;
	string s;
	cin >> s;
	vi v(s.size() - 1);
	rep(i,0,s.size() - 1)
		v[i] = abs(int(s[i+1]) - int(s[i]));
	if(v.size() == 1)
		ret(v[0]);
	
	int parity = ((v.front() + v.back()) & 1);
	if(v.size() > 2 and !(v.size() & 1))
		parity = ((parity + v[1] + v[v.size()-2]) & 1);
	if(parity == 1)
		ret(1);
	
	for(int& x : v)
		if(x == 1) ret(0); else x /= 2;
	parity = ((v.front() + v.back()) & 1);
	if(v.size() > 2 and !(v.size() & 1))
		parity = ((parity + v[1] + v[v.size()-2]) & 1);
	if(parity == 1)
		ret(2);
	ret(0);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:120:36: error: 'else' without a previous 'if'
  120 |                 if(x == 1) ret(0); else x /= 2;
      |                                    ^~~~
a.cc:120:41: error: 'x' was not declared in this scope
  120 |                 if(x == 1) ret(0); else x /= 2;
      |                                         ^
Language: C++

#include <algorithm>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
using namespace std::string_literals;
constexpr int N_max = 1'000'000;

constexpr int sub_table[4][4] = {
    {0, 1, 2, 3},
    {1, 0, 1, 2},
    {2, 1, 0, 1},
    {3, 2, 1, 0},
};

int main() {
    int n;
    string a;
    cin >> n >> a;

    char instr[20] = {};
    for (int i = 0; i < 10; i++)
        instr[i] = '0';

    int inlen = 10;
    int outlen = 9;

    const auto inc_str = [](char *s, int pos) {
        while (pos >= 0) {
            s[pos]++;
            if (s[pos] <= '3')
                break;
            s[pos] = '0';
            --pos;
        }
    };
    const auto solve = [](const char *s, int n) {
        char buf[2][20];
        char *a = buf[0];
        char *b = buf[1];
        for (int i = 0; i < n; i++)
            a[i] = s[i];

        while (n > 1) {
            for (int i = 0; i + 1 < n; i++) {
                auto s = sub_table[a[i] - '0'][a[i + 1] - '0'];
                b[i] = (char)(s + '0');
            }
            swap(a, b);
            n--;
        }
        return a[0];
    };

    auto m = map<string, string>();
    for (;;) {
        inc_str(instr, 9);
        char result[2] = {solve(instr, 10), '\0'};
        m.emplace(instr, result);
        if (strncmp(instr, "3333333333", 10) == 0)
            break;
    }

    const auto keylen = 10;
    auto b = string();
    while (a.length() >= keylen) {
        b.clear();
        for (auto i = 0; i + keylen <= a.length(); i++) {
            b.append(m[a.substr(i, keylen)]);
        }
        swap(a, b);
    }
    while (a.length() > 1) {
        b.resize(a.length() - 1, '*');
        for (int i = 0; i + 1 < a.length(); i++) {
            int sub = sub_table[a[i] - '0'][a[i + 1] - '0'];
            b[i] = (char)(sub + '0');
        }
        swap(a, b);
    }

    cout << a[0];
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:61:13: error: 'strncmp' was not declared in this scope
   61 |         if (strncmp(instr, "3333333333", 10) == 0)
      |             ^~~~~~~
a.cc:6:1: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <vector>
  +++ |+#include <cstring>
    6 | using namespace std;
Language: C++

#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
 
using namespace std;
 
typedef long long ll;
 
#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;
 
#define MOD 7

#define N_MAX 2000100

long long fact[N_MAX];
long long rfact[N_MAX];

long long modpow(long long a, long long b){ 
  long long r = 1LL;

  while(b){
    if(b & 1LL)r *= a;
    if(r >= MOD)r %= MOD;
    a *= a;
    if(a >= MOD)a %= MOD;
    b >>= 1LL;
  }
  return r%MOD;
}

long long nCr(long long n, long long r){ 
  long long ret = 1LL;
  ret *= fact[n];
  ret %= MOD;
  ret *= rfact[r];
  ret %= MOD;
  ret *= rfact[n-r];
  ret %= MOD;
  return ret%MOD;
}

int main(){
clr(fact,0);
fact[0]=1;
rep(i,1,N_MAX){
  fact[i] = fact[i-1]*i;
  fact[i] %= MOD;
}
clr(rfact,0);
rfact[0]=1;
rep(i,1,N_MAX){
  rfact[i] = rfact[i-1]*modpow(i,MOD-2);
  rfact[i] %= MOD;
}

  ll n;
  cin>>n;
  string s;
  cin>>s;
  vector<ll> v;
  ll flag = 0;
  rep(i,0,s.sz){
    if(s[i]=='2')flag = 1;
    v.pb(s[i]-'0');
  }
  if(flag==0){
    assert(false);
    if(s[0]!=s[s.sz-1]){
      cout << 2 << endl;
    }
    else{
      cout << 0 << endl;
    }
  }
  else{
    vector<ll> v1;
    rep(i,0,v.sz-1){
      v1.pb(abs(v[i]-v[i+1])%2);
    }
    n--;
    ll a = 0;
    rep(i,0,v1.sz){
      ll b = nCr(n-1,i)%2;
      ll c = v1[i];
      if(c==1&&b==1){
        a^=1;
      }
    }
    cout << a << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:93:5: error: 'assert' was not declared in this scope
   93 |     assert(false);
      |     ^~~~~~
a.cc:19:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
   18 | #include <utility>
  +++ |+#include <cassert>
   19 | #include <vector>
Language: Java

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br =new BufferedReader(new InputStreamReader(System.in));
        int n;
        n = Integer.parseInt(br.readLine());

        if (n >= 2) {
          int a[]=new int[n];
            String line = br.readLine(); // to read multiple integers line
            String[] strs = line.trim().split("\\s+");
            for (int i = 0; i < n; i++) {
                a[i] = Integer.parseInt(strs[i]);
            }
          int x[][]=new int[n][n];
          for(int i=0;i<n;i++){
              for(int j=0;j<n;j++){
                  if(i==0)
                      x[i][j]=a[j];
                  else if((i>=1&&i<n)&&(j>=0&&j<(n-i)))
                      x[i][j]=Math.abs(x[i-1][j] - x[i-1][j+1]);
              }
          }
            System.out.println(x[n-1][0]);
        }
    }
}


Compiler output:
Main.java:3: error: cannot find symbol
    public static void main(String[] args) throws IOException {
                                                  ^
  symbol:   class IOException
  location: class Main
Main.java:4: error: cannot find symbol
        BufferedReader br =new BufferedReader(new InputStreamReader(System.in));
        ^
  symbol:   class BufferedReader
  location: class Main
Main.java:4: error: cannot find symbol
        BufferedReader br =new BufferedReader(new InputStreamReader(System.in));
                               ^
  symbol:   class BufferedReader
  location: class Main
Main.java:4: error: cannot find symbol
        BufferedReader br =new BufferedReader(new InputStreamReader(System.in));
                                                  ^
  symbol:   class InputStreamReader
  location: class Main
4 errors
Language: C++

#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define mod 1000000007
#define fi first
#define se second
#define pii pair<int,int>
//#define int long long
#define endl '\n'
#define pll pair<long long,long long>
#define LONGLONG_MAX 100000000000000
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
long long power(long long a,long long b){
    long long ans=1;
    while(b>0){
        if(b&1){ans=(ans*a)%mod;}
                a=(a*a)%mod;
                b>>=1;
        }
    return ans;
        
}

int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    srand(time(0));
    int n;
    cin>>n;
    string s;
    cin>>s;
    vector<int>v;
    for(int i=0;i<n;i++){
        
        v.push_back(s[i]-'0');
    }
    int x=10000000/n;
    while(v.size()>1&&x--){
        n=v.size();
        vector<int>v1;
        for(int i=0;i<n-1;i++){
            //cout<<abs(v[i]-v[i+1])<<" ";
            v1.push_back(abs(v[i]-v[i+1]));
        }
        //cout<<endl;
        v=v1;
    }
    
    int n=v.size();
    for(int i=0;i<n;i++){
        ans+=(n-i)*v[i];
    }
    cout<<ans%2;
    return 0;
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:56:9: error: redeclaration of 'int n'
   56 |     int n=v.size();
      |         ^
a.cc:35:9: note: 'int n' previously declared here
   35 |     int n;
      |         ^
a.cc:58:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   58 |         ans+=(n-i)*v[i];
      |         ^~~
      |         abs
a.cc:60:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   60 |     cout<<ans%2;
      |           ^~~
      |           abs
Language: C++

#include <iostream>
#include <cstdlib>
#include <string>
#include <sstream>
#define MAX_N 1000000

using namespace std;

int N;
string s;
int a[MAX_N];
int aa[MAX_N][MAX_N];
bool conf[1000][1000];
string tmp;
int x(int i, int j) {
  if (conf[i][j] == true) {
    return aa[i][j];
  } 
  else {
    if (i == 1)  {
      // cout << i << ":" << j <<  " == " << a[j] << endl;
      aa[i][j] = a[j - 1];
      conf[i][j] = true;
      return aa[i][j];
    }
    else {
      // cout << i << ":" << j <<  " == " << abs(x(i - 1, j) - x(i - 1, j + 1)) << endl;
      aa[i][j] = abs(x(i - 1, j) - x(i - 1, j + 1));
      conf[i][j] = true;
      return aa[i][j];
    }
  }
}
int main() {
  cin >> N;
  cin >> s;
  // fill(aa[0], aa[MAX_N - 1], -1);
  for (int k = 0; k < N; k++ ) {
    tmp = s[k];
    a[k] = atoi(tmp.c_str());
  }
  cout << x(N, 1) << endl;
  return 0;
}


Compiler output:
/tmp/ccG0tX5Z.o: in function `x(int, int)':
a.cc:(.text+0x27): relocation truncated to fit: R_X86_64_PC32 against symbol `conf' defined in .bss section in /tmp/ccG0tX5Z.o
a.cc:(.text+0xc9): relocation truncated to fit: R_X86_64_PC32 against symbol `conf' defined in .bss section in /tmp/ccG0tX5Z.o
a.cc:(.text+0x175): relocation truncated to fit: R_X86_64_PC32 against symbol `conf' defined in .bss section in /tmp/ccG0tX5Z.o
/tmp/ccG0tX5Z.o: in function `main':
a.cc:(.text+0x211): relocation truncated to fit: R_X86_64_PC32 against symbol `tmp[abi:cxx11]' defined in .bss section in /tmp/ccG0tX5Z.o
a.cc:(.text+0x220): relocation truncated to fit: R_X86_64_PC32 against symbol `tmp[abi:cxx11]' defined in .bss section in /tmp/ccG0tX5Z.o
/tmp/ccG0tX5Z.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x2d0): relocation truncated to fit: R_X86_64_PC32 against symbol `tmp[abi:cxx11]' defined in .bss section in /tmp/ccG0tX5Z.o
a.cc:(.text+0x2e9): relocation truncated to fit: R_X86_64_PC32 against symbol `tmp[abi:cxx11]' defined in .bss section in /tmp/ccG0tX5Z.o
collect2: error: ld returned 1 exit status
Language: Java

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n;
        n = sc.nextInt();
        sc.nextLine();


        if (n >= 2) {
          int a[]=new int[n];
          for(int i=0;i<n;i++) {
              a[i]=sc.nextInt();
          }
          int x[][]=new int[n][n];
          for(int i=0;i<n;i++){
              for(int j=0;j<n;j++){
                  if(i==0)
                      x[i][j]=a[j];
                  else if((i>=1&&i<n)&&(j>=0&&j<(n-i)))
                      x[i][j]=Math.abs(x[i-1][j] - x[i-1][j+1]);
              }
          }
            System.out.println(x[n-1][0]);
        }
    }
}


Compiler output:
Main.java:4: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

//#include "pch.h"
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>

#include <vector>
#include <set>
#include <map>
#include <iostream>
#include <utility>
#include <queue>
#include <algorithm>
#include <functional>
#include <string>
#include <bitset>

#define ll long long
#define fri(n) for(i=0;i<(n);i++)
#define frj(n) for(j=0;j<(n);i++)
#define min(p,q) ((p)<(q)?(p):(q))
#define max(p,q) ((p)>(q)?(p):(q))
#define INF 1000000000000000000//10^18
#define INFINT 2000000001//2*10^9+1
#define MOD 1000000007
#define MODANOTHER 998244353
#define PI acos(-1)

using namespace std;

//static??
int culc(int n,int sint[1000010]){

	int i;
	int flag;

	flag=0;
	for(i=0;i<n-1;i++){
		if(sint[i]==1){
			flag=1;
		}
	}

	if(flag==0){
		if(((sint[0]+sint[n-2])%4)==0){
			return 0;
		}else{
			return 2;
		}
	}else{
		if(((sint[0]+sint[n-2])%2)==0){
			return 0;
		}else{
			return 1;
		}
	}
}

int check(int n,int sint[1000010]){
	int i,j;

	int d[100][100];
	for(i=0;i<n-1;i++){
		d[0][i]=sint[i];
	}

	for(i=1;i<n;i++){
		for(j=0;j<n;j++){
			d[i][j]=abs(d[i-1][j+1]-d[i-1][j]);
		}
	}
	
	return d[n-2][0];
}

int main(void)
{
	//変数の宣言
	int n,m;
	int h,w;
	static char s[1000010];
	static int sint[1000010];

	//よく使う変数
	int i,j,k,l;
	int flag=0;
	int ans=0;
	int count=0;
	int temp=0;
	int temp1=0;
	int temp2=0;
	int temp3=0;
	static int vec[100010];
	int max=0;
	int min=INFINT;
	int len=0;
	int sum=0;
	int ok=0;
	int ng=0;
	char dummy;
	static char stemp[100010];
	
	//データの読み込み


	scanf("%d",&n);
//	scanf_s("%d",&n);


	scanf("%s",&s);
//	scanf_s("%s",&s,1000010);


/*	for(i=0;i<10;i++){
		for(j=0;j<10;j++){
//			scanf("%d",c[i][j]);
			scanf_s("%d",&c[i][j]);
		}
	}*/

/*	for(i=0;i<h;i++){
//		scanf("%s",&c[i][j]);
		scanf_s("%s",&c[i],310);
	}*/


/*	for(i=0;i<3;i++){
//		scanf("%s",&s);
		scanf_s("%s",&s[i],100010);
	}*/


	//	printf("nは%dです\n", n);
	//	printf("データの読み込み終了\n");
	//実際の処理

//	clock_t start=clock();

	for(i=0;i<n-1;i++){
		sint[i]=abs(s[i+1]-s[i]);
	}

	if(n==2){
		printf("%d",sint[0]);
		return 0;
	}

	printf("%d",culc(sint));
	/*
	for(i=0;i<729;i++){
		temp=i;
		j=0;
		while(j<7){
			sint[j]=temp%3;
			temp=temp/3;
			j++;
		}

		temp=culc(6,sint);
		temp2=check(6,sint);

		//printf("[%d]:%d,%d\n",i,temp,temp2);
		if(temp!=temp2){
			printf("[%d]:%d,%d\n",i,temp,temp2);
			printf("不一致！！！！\n");
		}
	}*/

//	clock_t end=clock();

	//	printf("計算部分終了\n");

	//出力
	
	//printf("%d",(d[i-1][j-1]+1)/2);

//	printf("time=%lf",(double)(end-start)/CLOCKS_PER_SEC);
	//	printf("結果の出力終了\n");

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:149:26: error: invalid conversion from 'int*' to 'int' [-fpermissive]
  149 |         printf("%d",culc(sint));
      |                          ^~~~
      |                          |
      |                          int*
a.cc:149:25: error: too few arguments to function 'int culc(int, int*)'
  149 |         printf("%d",culc(sint));
      |                     ~~~~^~~~~~
a.cc:33:5: note: declared here
   33 | int culc(int n,int sint[1000010]){
      |     ^~~~
Language: C++

#include <iostream>
#include <cstdlib>
#include <string>
#include <sstream>
#define MAX_N 1000000

using namespace std;

int N;
string s;
int a[MAX_N];
int aa[MAX_N][MAX_N];
bool aa2[MAX_N][MAX_N];
string tmp;
int x(int i, int j) {
  if (aa2[i][j] == true) {
    return aa[i][j];
  } 
  else {
    if (i == 1)  {
      // cout << i << ":" << j <<  " == " << a[j] << endl;
      aa[i][j] = a[j - 1];
      aa2[i][j] = true;
      return aa[i][j];
    }
    else {
      // cout << i << ":" << j <<  " == " << abs(x(i - 1, j) - x(i - 1, j + 1)) << endl;
      aa[i][j] = abs(x(i - 1, j) - x(i - 1, j + 1));
      aa2[i][j] = true;
      return aa[i][j];
    }
  }
}
int main() {
  cin >> N;
  cin >> s;
  // fill(aa[0], aa[MAX_N - 1], -1);
  for (int k = 0; k < N; k++ ) {
    tmp = s[k];
    a[k] = atoi(tmp.c_str());
  }
  cout << x(N, 1) << endl;
  return 0;
}


Compiler output:
/tmp/ccu3cyrs.o: in function `x(int, int)':
a.cc:(.text+0x27): relocation truncated to fit: R_X86_64_PC32 against symbol `aa2' defined in .bss section in /tmp/ccu3cyrs.o
a.cc:(.text+0xc9): relocation truncated to fit: R_X86_64_PC32 against symbol `aa2' defined in .bss section in /tmp/ccu3cyrs.o
a.cc:(.text+0x175): relocation truncated to fit: R_X86_64_PC32 against symbol `aa2' defined in .bss section in /tmp/ccu3cyrs.o
/tmp/ccu3cyrs.o: in function `main':
a.cc:(.text+0x211): relocation truncated to fit: R_X86_64_PC32 against symbol `tmp[abi:cxx11]' defined in .bss section in /tmp/ccu3cyrs.o
a.cc:(.text+0x220): relocation truncated to fit: R_X86_64_PC32 against symbol `tmp[abi:cxx11]' defined in .bss section in /tmp/ccu3cyrs.o
/tmp/ccu3cyrs.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x2d0): relocation truncated to fit: R_X86_64_PC32 against symbol `tmp[abi:cxx11]' defined in .bss section in /tmp/ccu3cyrs.o
a.cc:(.text+0x2e9): relocation truncated to fit: R_X86_64_PC32 against symbol `tmp[abi:cxx11]' defined in .bss section in /tmp/ccu3cyrs.o
collect2: error: ld returned 1 exit status
Language: C++


#include "bits/stdc++.h"
#define rep(i,n) for(long i=0;i<n;i++)
using namespace std;
long get2power(long n) {
	long result = 0;
	while (n % 2 == 0) {
		n = n / 2;
		result++;
	}
	return result;
}
long main()
{
	long N;
	string s;
	cin >> N >> s;
	vector<long> next(N-1);
	long ans=0;
	for (long i = 0; i < N-1; i++)
	{
		next[i] = abs((s[i] - '0') - (s[i+1] - '0'));
	}
	long p = 0, n = 0;
	for (long i = 0; i < N - 2; i++)
	{
		next[i] = (p - n == 0) ? next[i] : 0;
		p += get2power(N - 2 - i);
		n += get2power(i+1);
	}
	next[N-2] = (p - n == 0) ? next[N-2] : 0;

	for (long i = 0; i < N-1; i++)
	{
		ans = abs(ans - next[i]);
	}

	if (N == 2) {
		ans = abs((s[0] - '0')- (s[1] - '0'));
	}
	cout << ans;
	return 0;
}


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

#include<iostream>
#include<vector>
using namespace std;
int main(){
    int N;
    cin >> N;
    vector<int> vec;
    string numstr;
    cin >> numstr;
    for(int i=0;i<N;i++){
        char c = numstr[i];
        vec.push_back(atoi(&c));
    }
    for(int i=N-1;i>0;i--){
        for(int j=0;j<i;j++){
            vec[j] = abs(vec[j]-vec[j+1]);
            if(vec[j]==0 && i!=2){
                vec.erase(vec.begin()+j);
                i--;
                j--;
                //cout << vec[j];
            }
        }
    }
    cout << vec[0] << endl;    

Compiler output:
a.cc: In function 'int main()':
a.cc:25:28: error: expected '}' at end of input
   25 |     cout << vec[0] << endl;
      |                            ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
#define Priq priority_queue<int,vi,greater<int>>
#define pb push_back
#define mp make_pair
#define INF (1ll<<60)
signed main(){
  int N; cin>>N;
  string S; cin>>S;
  vi A(N);
  rep(i,0,N) A[i]=S[i]-'0';
  vi B(N);
  rep(i,0,N-1) B[i]=abs(A[i]-A[i+1]);
  if(N==2) cout<<B[0]<<endl;
  else{
    vi C(N);
    rep(i,0,N-2) C[i]=abs(B[i]-B[i+1]);
    if(N==3) cout<<C[0]<<endl;
    else{
      N-=3;
      vi D(N);
      rep(i,0,N-3) D[i]=abs(C[i]-C[i+1]);
      while(N--){
        bitset<60> B(N);
        if(B.count(N)){
          int ans=0;
          rep(i,0,N) ans^=D[i];
          cout<<ans<<endl;
          break;
        }
        vi E(N-1);
        rep(i,0,N-1) E[i]=D[i]^D[i+1];
        rep(i,0,N-1) D[i]=E[i];
      }
    }
  }
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:37:19: error: no matching function for call to 'std::bitset<60>::count(long long int&)'
   37 |         if(B.count(N)){
      |            ~~~~~~~^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bitset:1366:7: note: candidate: 'std::size_t std::bitset<_Nb>::count() const [with long unsigned int _Nb = 60; std::size_t = long unsigned int]'
 1366 |       count() const _GLIBCXX_NOEXCEPT
      |       ^~~~~
/usr/include/c++/14/bitset:1366:7: note:   candidate expects 0 arguments, 1 provided
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    long N=sc.nextLong();
    String M =sc.next();
    String m[] =M.split("",0);
    long n[][] =new long[N][N];
    for(int k=0;k<N;k++){
      n[0][k]=Integer.parseInt(m[k]);}
    for(int i=1;i<N;i++){
      for(int j=0;j<N-i;j++){
        n[i][j]=Math.abs(n[i-1][j]-n[i-1][j+1]);
      }
    }
    System.out.println(n[N-1][0]);
  }
}


Compiler output:
Main.java:8: error: incompatible types: possible lossy conversion from long to int
    long n[][] =new long[N][N];
                         ^
Main.java:8: error: incompatible types: possible lossy conversion from long to int
    long n[][] =new long[N][N];
                            ^
Main.java:16: error: incompatible types: possible lossy conversion from long to int
    System.out.println(n[N-1][0]);
                          ^
3 errors
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    long N=sc.nextLong();
    String M =sc.next();
    String m[] =M.split("",0);
    int n[][] =new int[N][N];
    for(int k=0;k<N;k++){
      n[0][k]=Integer.parseInt(m[k]);}
    for(int i=1;i<N;i++){
      for(int j=0;j<N-i;j++){
        n[i][j]=Math.abs(n[i-1][j]-n[i-1][j+1]);
      }
    }
    System.out.println(n[N-1][0]);
  }
}


Compiler output:
Main.java:8: error: incompatible types: possible lossy conversion from long to int
    int n[][] =new int[N][N];
                       ^
Main.java:8: error: incompatible types: possible lossy conversion from long to int
    int n[][] =new int[N][N];
                          ^
Main.java:16: error: incompatible types: possible lossy conversion from long to int
    System.out.println(n[N-1][0]);
                          ^
3 errors
Language: C++

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <unordered_map>
#include <vector>
#include <string.h>
#include <set>
#include <time.h>       /* time */

using namespace std;

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> void printvec(const vector<T>& v) {
  for (auto x : v) { cout << x << " "; }
  cout << endl;
}
template<class T> void printtree(const vector< vector<T> >& tree) {
  for (long long i = 0; i < tree.size(); ++i) {
    cout << i + 1 << ": "; printvec(tree[i]);
  }
}
template<class T, class U> void printmap(const map<T, U>& mp) {
  for (auto x : mp) { cout << x.first << "=>" << x.second << endl; }
}

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

#define rep(i, n) for(ll i = 0; i < n; ++i)
#define all(s) s.begin(), s.end()
#define fr first
#define sc second
#define mp make_pair
#define pb push_back

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> triple;
typedef double D;

const ll INF = 1e9;
const ll MOD = 1000000007;  // 1e9 + 7

int main(int argc, char** argv) {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  //cout << setprecision(10) << fixed;

  ll n;
  cin >> n;
  string a;
  cin >> a;
  if (n <= 30000) {
    vector<ll> d(n);
    rep(i, n) {
      d[i] = (a[i] - '0') - 1;
    }

    rep(iter, n-1) {
      // cout << "d:"; printvec(d);
      rep(i, n - iter - 1) {
        d[i] = abs(d[i] - d[i+1]);
      }
      // d.resize(n-iter-1);
    }
    cout << d[0] << endl;
  } else {
     srand (time(NULL));
    // cout << rand() % 2 << endl; // 0 or 1
    if ((rand % 5) == 4) {
      cout << 0 << endl;
    } else if (rand % 5 == 4) {
      cout << 1 << endl;
    } else {
      cout << 2 << endl;
    }
  }
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:79:15: error: invalid operands of types 'int() noexcept' and 'int' to binary 'operator%'
   79 |     if ((rand % 5) == 4) {
      |          ~~~~ ^ ~
      |          |      |
      |          |      int
      |          int() noexcept
a.cc:81:21: error: invalid operands of types 'int() noexcept' and 'int' to binary 'operator%'
   81 |     } else if (rand % 5 == 4) {
      |                ~~~~ ^ ~
      |                |      |
      |                |      int
      |                int() noexcept
Language: Java

import java.util.*;
 
public class Main{
    public static void main(String[] args){
		public static final int MAX_N = 1000000;
        Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		String a = sc.next();
		String b[] = new String[MAX_N];
		int d[][] = new int[MAX_N][MAX_N];
 
        for(int i=0; i<N; i++){
			b = a.split("");
			d[0][i]=Integer.valueOf(b[i]);
		}
	
		for(int i=1; i<N; i++){
			for(int j=0; j<N-i; j++){
				d[i][j]=Math.abs(d[i-1][j]-d[i-1][j+1]);
			}
		}

                System.out.println(d[N-1][0]);
    }
}

Compiler output:
Main.java:5: error: illegal start of expression
		public static final int MAX_N = 1000000;
		^
Main.java:12: error: illegal start of type
        for(int i=0; i<N; i++){
        ^
Main.java:12: error: > or ',' expected
        for(int i=0; i<N; i++){
                        ^
Main.java:12: error: <identifier> expected
        for(int i=0; i<N; i++){
                           ^
Main.java:17: error: illegal start of type
		for(int i=1; i<N; i++){
		^
Main.java:17: error: > or ',' expected
		for(int i=1; i<N; i++){
		                ^
Main.java:17: error: <identifier> expected
		for(int i=1; i<N; i++){
		                   ^
Main.java:23: error: <identifier> expected
                System.out.println(d[N-1][0]);
                                  ^
Main.java:23: error: ']' expected
                System.out.println(d[N-1][0]);
                                     ^
Main.java:23: error: ',', ')', or '[' expected
                System.out.println(d[N-1][0]);
                                      ^
Main.java:25: error: class, interface, enum, or record expected
}
^
11 errors
Language: C

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

int Factrial( int n );

int main (void){
    int N, num;
    int i, Z, Y;

    scanf("%d", &Z );
    scanf("%d", &N );

    Z = Z - 1;
    for ( num = 0; Z > 0; Z-- ){
//        printf("%d %d\n", N, Z);
        for ( Y = Z; Y > 0; Y-- ){
            num += abs(N / Factrial(Y) - N % Factrial(Y) / Factrial(Y - 1)) * Factrial(Y - 1);
          	N = N % Factrial(Y);
//          	printf("%d %d\n", num);
        }
        N = num;
        num = 0;
    }
    printf("%d\n", N);
    return 0;
}

// 引数によって階乗を求める
int Factrial( int n ){
    åint i, num = 1;
    for ( i = 0; i < n; i++ ){
        num = num * 10;
    }
    return num;
}


Compiler output:
main.c: In function 'Factrial':
main.c:30:5: error: unknown type name '\U000000e5int'
   30 |     åint i, num = 1;
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define re register
inline int read(){
	re int t=0;
	re char v=getchar();
	while(v<'0')v=getchar();
	while(v>='0')t=(t<<3)+(t<<1)+v-48,v=getchar();
	return t;
}
char s[1000002];
int n,a[1000002],sum;
int main(){
	n=read();
	scanf("%s",s+1);
	if(n>20000){
	for(re int i=1;i<=n;++i)a[i]=s[i]-'0',sum+=a[i];
	sum-=a[1];
	printf("%d",absa[1]-sum%3());}
	else{
	for(re int i=1;i<=n;++i)a[i]=s[i]-'0';
	for(re int i=1;i<n;++i)
	for(re int j=1;j<=n-i;++j){
		a[j]=abs(a[j]-a[j+1]);
	}
	printf("%d",a[1]);}
}


Compiler output:
a.cc: In function 'int read()':
a.cc:5:16: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    5 |         re int t=0;
      |                ^
a.cc:6:17: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    6 |         re char v=getchar();
      |                 ^
a.cc: In function 'int main()':
a.cc:17:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   17 |         for(re int i=1;i<=n;++i)a[i]=s[i]-'0',sum+=a[i];
      |                    ^
a.cc:19:21: error: 'absa' was not declared in this scope; did you mean 'abs'?
   19 |         printf("%d",absa[1]-sum%3());}
      |                     ^~~~
      |                     abs
a.cc:19:34: error: expression cannot be used as a function
   19 |         printf("%d",absa[1]-sum%3());}
      |                                 ~^~
a.cc:21:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   21 |         for(re int i=1;i<=n;++i)a[i]=s[i]-'0';
      |                    ^
a.cc:22:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   22 |         for(re int i=1;i<n;++i)
      |                    ^
a.cc:23:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   23 |         for(re int j=1;j<=n-i;++j){
      |                    ^
Language: C++

#include <iostream>
#include <cstdlib>
#include <string>
#include <sstream>
#define MAX_N 1000000

using namespace std;

int N;
string s;
int a[MAX_N];
int aa[MAX_N][MAX_N];
int aa2[MAX_N][MAX_N];
string tmp;
int x(int i, int j) {
  if (aa2[i][j] == 1) {
    return aa[i][j];
  } 
  else {
    if (i == 1)  {
      // cout << i << ":" << j <<  " == " << a[j] << endl;
      aa[i][j] = a[j - 1];
      aa2[i][j] = 1;
      return aa[i][j];
    }
    else {
      // cout << i << ":" << j <<  " == " << abs(x(i - 1, j) - x(i - 1, j + 1)) << endl;
      aa[i][j] = abs(x(i - 1, j) - x(i - 1, j + 1));
      aa2[i][j] = 1;
      return aa[i][j];
    }
  }
}
int main() {
  cin >> N;
  cin >> s;
  // fill(aa[0], aa[MAX_N - 1], -1);
  for (int k = 0; k < N; k++ ) {
    tmp = s[k];
    a[k] = atoi(tmp.c_str());
  }
  cout << x(N, 1) << endl;
  return 0;
}


Compiler output:
/tmp/ccImRhuv.o: in function `x(int, int)':
a.cc:(.text+0x2f): relocation truncated to fit: R_X86_64_PC32 against symbol `aa2' defined in .bss section in /tmp/ccImRhuv.o
a.cc:(.text+0xd3): relocation truncated to fit: R_X86_64_PC32 against symbol `aa2' defined in .bss section in /tmp/ccImRhuv.o
a.cc:(.text+0x188): relocation truncated to fit: R_X86_64_PC32 against symbol `aa2' defined in .bss section in /tmp/ccImRhuv.o
/tmp/ccImRhuv.o: in function `main':
a.cc:(.text+0x225): relocation truncated to fit: R_X86_64_PC32 against symbol `tmp[abi:cxx11]' defined in .bss section in /tmp/ccImRhuv.o
a.cc:(.text+0x234): relocation truncated to fit: R_X86_64_PC32 against symbol `tmp[abi:cxx11]' defined in .bss section in /tmp/ccImRhuv.o
/tmp/ccImRhuv.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x2e4): relocation truncated to fit: R_X86_64_PC32 against symbol `tmp[abi:cxx11]' defined in .bss section in /tmp/ccImRhuv.o
a.cc:(.text+0x2fd): relocation truncated to fit: R_X86_64_PC32 against symbol `tmp[abi:cxx11]' defined in .bss section in /tmp/ccImRhuv.o
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
using namespace std;
int arr[1000010],dy[1000010];
int forwarddely(int y[],int &del){
    int k = 0;
    while(del != 0){
        dy[k++] = y[0];
        for(int i=0; i<del-1; i++){
            y[i] = abs(y[i+1]-y[i]);
        }
        del--;
        if(del == 0)
            return dy[k-1];
    }
}
 
int main()
{
    int m,i,j;
    string n;
    cin>>m>>n;
    for(i=0;i<m;i++)
    {
        arr[i] = n[i] - '0';
    }
    cout<<forwarddely(arr,m)<<endl;
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
int arr[10000],dy[10000];
int forwarddely(int y[],int &del){
    int k = 0;
    while(del != 0){
        dy[k++] = y[0];
        for(int i=0; i<del-1; i++){
            y[i] = abs(y[i+1]-y[i]);
        }
        del--;
        if(del == 0)
            return dy[k-1];
    }
}

int main()
{
    int m,i,j;
    string n;
    cin>>m>>n;
    for(i=0;i<m;i++)
    {
        arr[i] = n[i] - '0';
    }
    cout<<forwarddely(arr,m)<<endl;
    return 0;
}


Compiler output:
a.cc:31:5: error: conflicting declaration 'int arr [10000]'
   31 | int arr[10000],dy[10000];
      |     ^~~
a.cc:3:5: note: previous declaration as 'int arr [1000010]'
    3 | int arr[1000010],dy[1000010];
      |     ^~~
a.cc:31:16: error: conflicting declaration 'int dy [10000]'
   31 | int arr[10000],dy[10000];
      |                ^~
a.cc:3:18: note: previous declaration as 'int dy [1000010]'
    3 | int arr[1000010],dy[1000010];
      |                  ^~
a.cc:32:5: error: redefinition of 'int forwarddely(int*, int&)'
   32 | int forwarddely(int y[],int &del){
      |     ^~~~~~~~~~~
a.cc:4:5: note: 'int forwarddely(int*, int&)' previously defined here
    4 | int forwarddely(int y[],int &del){
      |     ^~~~~~~~~~~
a.cc:45:5: error: redefinition of 'int main()'
   45 | int main()
      |     ^~~~
a.cc:17:5: note: 'int main()' previously defined here
   17 | int main()
      |     ^~~~
a.cc: In function 'int forwarddely(int*, int&)':
a.cc:15:1: warning: control reaches end of non-void function [-Wreturn-type]
   15 | }
      | ^
a.cc: In function 'int forwarddely(int*, int&)':
a.cc:43:1: warning: control reaches end of non-void function [-Wreturn-type]
   43 | }
      | ^
Language: C++

#include <iostream>
int main()
{
  int n;
  std::cin >> n;
  int arr[n];
  char c[n];
  scanf("%[^/n]s",c);
  int i=0;
  for(i=0;i<n;i++)
  {
    arr[i]=c[i]-'0';
  }
  int j;
  for(i=0;i<n;i++)
  {
    for(j=1;j<n;j++)
    {
      arr[j-1]=arr[j-1]-a[j];
      arr[j-1]=arr[j-1]>0?arr[j-1]:-arr[j-1];
    }
  }
  std::cout << arr[0] << "\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:25: error: 'a' was not declared in this scope
   19 |       arr[j-1]=arr[j-1]-a[j];
      |                         ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

const int N=1e6+3;

const double eps=0.000000001;

#define pb push_back
#define all(x) (x).begin(),(x).end()
typedef long long ll;

const int dx[]={1,-1,0,0},
		  dy[]={0,0,1,-1};

const int inf=1e9,mod=1e9+7;

int n,m,a[N],b[N],k,q,u,v,x,y,tc,l,r,c,ans,cnt[100005];

char s[N];

void IO(){
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	#ifndef ONLINE_JUDGE
		freopen("test.txt","r",stdin);
	#endif
}

int p[1005][1005];

int main(){
	print("2");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:9: error: 'print' was not declared in this scope; did you mean 'rint'?
   33 |         print("2");
      |         ^~~~~
      |         rint
Language: C++

#include <bits/stdc++.h>
int main()
{
  int n;
  std::cin >> n;
  int arr[n];
  char c[n];
  scanf("%[^/n]s",s);
  int i=0;
  for(i=0;i<n;i++)
  {
    arr[i]=c[i]-'0';
  }
  int j;
  for(i=0;i<n;i++)
  {
    for(j=1;j<n;j++)
    {
      arr[j-1]=arr[j-1]-a[j];
      arr[j-1]=arr[j-1]>0?arr[j-1]:-arr[j-1];
    }
  }
  cout << arr[0] << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: 's' was not declared in this scope
    8 |   scanf("%[^/n]s",s);
      |                   ^
a.cc:19:25: error: 'a' was not declared in this scope
   19 |       arr[j-1]=arr[j-1]-a[j];
      |                         ^
a.cc:23:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   23 |   cout << arr[0] << "\n";
      |   ^~~~
      |   std::cout
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
#define vector2(a,b,c) vector<vector<int>> a(b/*縦！w*/,vector<int>(c/*横！w*/))
#define INF 1e10
#define MOD 1e9+7
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using Graph = vector<vector<int>>;
struct edge{int from,to,cost;};
signed main(){
  int a;
  cin>>a;
  vector<char> b(a);
  rep(i,a){
  cin>>b[i];
    b[i]-=48;
  }
  bool k1=0,k2=0,k3=0,;
  rep(i,a){
    if(b[i]==1)
      k1=1;
    else if(b[i]==2)
    k2=1;
    else
    k3=1;
  }
  if(k1&&k3&&(!k2))
    cout<<2;
  else
    cout<<0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:23: error: expected unqualified-id before ';' token
   26 |   bool k1=0,k2=0,k3=0,;
      |                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,x=0,y=0,z=0;string S;
  cin>>N>>S;
  for(int i=0;i<N;i++){ 
    if(S[i]=='1')x++;
    else if(S[i]=='2')y++;
    else z++;
  }
  if(x*y+y*z+z*x){
    if(x*y*z){
      long long int a=(1<<(x-1))+(1<<(x+y-1));
      for(int i=1;i<N-1;i++)a^=(a>>1);
      cout<<(a&1)<<endl;
    }
    else{ 
      long long int a,b=1;
      if(x==0)a=(1<<(y-1));
      else a=(1<<(x-1))
      for(int i=1;i<N-1;i++)a^=(a>>1);
      if(y==0)b=2;
      cout<<b*(a&1)<<endl; 
    }
  }
  else cout<<"0"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:24: error: expected ';' before 'for'
   20 |       else a=(1<<(x-1))
      |                        ^
      |                        ;
   21 |       for(int i=1;i<N-1;i++)a^=(a>>1);
      |       ~~~               
a.cc:21:19: error: 'i' was not declared in this scope
   21 |       for(int i=1;i<N-1;i++)a^=(a>>1);
      |                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
#define INF 1e10
#define MOD 1e9+7
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using Graph = vector<vector<int>>;
int fg(int k){
    int sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum *= i;
    }
    return sum;
}
signed main(){
  int N;
  cin>>N;
  vector <char> vec(N);
  rep(i,N){
  cin>>vec[i];
  vec[i]-=48;
  }
  rep(i,N){
    if(vec[i]==2){
  int x=0;
  rep(i,N-1){
    x+=abs(vec[i]-vec[i+1]);
   }
   if(x%2==0){
     cout<<0;
   }
   else{
     cout<<1;
     }
    break;
    }
    else if(i==N-1){
      cout<<2;
    }
    else{
      continue;
    }
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:52:3: error: expected '}' at end of input
   52 |  }
      |   ^
a.cc:24:14: note: to match this '{'
   24 | signed main(){
      |              ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
#define vector2(a,b,c) vector<vector<int>> a(b/*縦！w*/,vector<int>(c/*横！w*/))
#define INF 1e10
#define MOD 1e9+7
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using Graph = vector<vector<int>>;
struct edge{int from,to,cost;};
signed main(){
  cin>>a;
  vector<char> b(a);
  rep(i,a){
  cin>>b[i];
    b[i]-=48;
  }
  bool k=1;
  rep(i,a){
  if(!(b[i]==1||b[i]==3))
    k=0;
  }
  if(k)
    cout<<2;
  else
    cout<<0;
}

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

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
#define INF 1e10
#define MOD 1e9+7
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using Graph = vector<vector<int>>;
int fg(int k){
    int sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum *= i;
    }
    return sum;
}
signed main(){
  int N;
  cin>>N;
  vector <char> vec(N);
  rep(i,N){
  cin>>vec[i];
  vec[i]-=48;
  }
  int x=0;
  rep(i,N-1){
    x+=abs(vec[i]-vec[i+1];
   }
   if(x%2==0){
     cout<<0;
   }
   else{
     cout<<1;
     }
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:34:27: error: expected ')' before ';' token
   34 |     x+=abs(vec[i]-vec[i+1];
      |           ~               ^
      |                           )
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
#define INF 1e10
#define MOD 1e9+7
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using Graph = vector<vector<int>>;
int fg(int k){
    int sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum *= i;
    }
    return sum;
}
signed main(){
  int N;
  cin>>N;
  vector <char> vec(N);
  rep(i,a){
  cin>>vec[i];
  vec[i]-=48;
  }
  int x=0;
  rep(i,a-1){
    x+=abs(vec[i]-vec[i+1];
   }
   if(x%2==0){
     cout<<0;
   }
   else{
     cout<<1;
     }
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:28:9: error: 'a' was not declared in this scope
   28 |   rep(i,a){
      |         ^
a.cc:4:32: note: in definition of macro 'rep'
    4 | #define rep(i,n) for(int i=0;i<n;i++)
      |                                ^
a.cc:33:9: error: 'a' was not declared in this scope
   33 |   rep(i,a-1){
      |         ^
a.cc:4:32: note: in definition of macro 'rep'
    4 | #define rep(i,n) for(int i=0;i<n;i++)
      |                                ^
a.cc:34:27: error: expected ')' before ';' token
   34 |     x+=abs(vec[i]-vec[i+1];
      |           ~               ^
      |                           )
Language: C++

#include <iostream>
#include<math.h>
#include <string>
#define NMAX 1000005
using namespace std;

int mat[NMAX];
int mat2[NMAX];

int main()
{
	int N;
	cin >> N;
	string s;
	cin >> s;
	for (size_t i = 0; i < N; i++)
	{
		mat[i] = s[i] - '0';
	}

	for (size_t i = 1; i < N; i++)
	{
		for (size_t j = 0; j < N-i; j++)
		{
			mat2[j] = abs(mat[j]-mat[j+1]);
		}
		memcpy(mat, mat2, NMAX * sizeof(int));
	}
	cout << mat[0];
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:17: error: 'memcpy' was not declared in this scope
   27 |                 memcpy(mat, mat2, NMAX * sizeof(int));
      |                 ^~~~~~
a.cc:3:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<math.h>
  +++ |+#include <cstring>
    3 | #include <string>