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

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;
bool prime(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd(b,a%b);
  }
}
 
long long lcm(long long x, long long y){
  return (x/gcd(x,y))*y;
}
 
class UnionFind {
    public:
    //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
    vector<int> Parent;
    
    //クラスを作るときは、Parentの値を全て-1にする。
    //以下のようにすると全てバラバラの頂点として解釈できる。
    UnionFind(int N) {
        Parent = vector<int>(N, -1);
    }
    
    //Aがどのグループに属しているか調べる
    int root(int A) {
        if (Parent[A] < 0) return A;
        return Parent[A] = root(Parent[A]);
    }
    
    //自分のいるグループの頂点数を調べる
    int size(int A) {
        return -Parent[root(A)];//先祖をrootで取っておきたい。
    }
    
    //AとBをくっ付ける
    bool connect(int A, int B) {
        //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
        A = root(A);
        B = root(B);
        if (A == B) {
            //すでにくっついてるからくっ付けない
            return false;
        }
        
        //大きい方(A)に小さいほう(B)をくっ付けたい
        //大小が逆だったらAとBをひっくり返す。
        if (size(A) < size(B)) swap(A, B);
        
        //Aのサイズを更新する
        Parent[A] += Parent[B];
        //Bの親をAに変更する
        Parent[B] = A;
        
        return true;
    }
};


  
int main(){
  int n;
  cin>>n;
  if(n==1){
    cout<<1<<endl;
    return 0;
  }
  int a[n];
  int m;
  int s;
  //bool flag=false;
  vector<int> ms;
  REP(i,n){
    cin>>a[i];
  }
  REP(i,n){
    if(i==0){
      ms.push_back(a[i]);
      continue;
    }
    m = ms.size();
    if(ms[0]>=a[i]){
      it = ms.begin();
      ms.insert(it,a[i]);
    }else{
      int l=0,r=m;
      while(r-l>1){
        s = (l+r)/2;
        if(ms[s]<a[i]){
          l = s;
        }else{
          r = s;
        }
      }
      ms[l]=a[i];
    }
  }
  
  int ans = ms.size();
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:113:7: error: 'it' was not declared in this scope; did you mean 'i'?
  113 |       it = ms.begin();
      |       ^~
      |       i
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i, n) FOR(i, 0, (n))
#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define LAR(a, b) ((a)=max((a),(b)))
#define SML(a, b) ((a)=min((a),(b)))
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pair<int, int>> vpii;
typedef pair<int, int> pii;
#define PB push_back
#define EB emplace_back
#ifdef LOCAL_DEBUG
#define DEBUG(...) printf(__VA_ARGS__)
#else
#define DEBUG(...)
#endif

class BIT
{
public:
    vector<int> bit;
    int M;

    BIT(int M):
        bit(vector<int>(M+1, 0)), M(M) {}

    int sum_(int i) {
        if (!i) return 0;
        return bit[i] + sum_(i-(i&-i));
    }

		int sum(int i){
			return sum_(i+1);
		}

    void add_(int i, int x) {
        if (i > M) return;
        bit[i] += x;
        add_(i+(i&-i), x);
    }
		
		void add(int i, int x){
			add_(i+1, x);
		}
};

#define N 112345
int a[N];
multiset<int> s;

int main(){
	int n; scanf("%d", &n);
	REP(i, n){
		scanf("%d", a+i);
	}
	int ans = 0;
	for(int i = n-1; i>=0; i--){
		auto it = s.upper_bound(a[i]);
		if(it == s.end()){
			ans++;
		} else {
			s.erase(it);
		}
		s.insert(a[i]);
	}
	printf("%d\n", ans)g
}





Compiler output:
a.cc: In function 'int main()':
a.cc:69:28: error: expected ';' before 'g'
   69 |         printf("%d\n", ans)g
      |                            ^
      |                            ;
Language: C++

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

int main(){
  int N;
  cin >> N;
  vector<int> a(n);
  vector<int> b(n);
  for(int i=0;i<N;i++){
    cin >> a[i];
    b[i] = 0;
  }
  int cnt=0;
  int p;
  for(int i=0;i<N-1;i++){
    if(b[i]==0){
      p=a[i];
      cnt++;
      b[i] = 1;
      for(int j=i+1;j<N;j++){
        if(b[j]==0){
         if(p < a[j]){
           b[j] = 1;
         }
        }
      }
    }
  }
  
  cout << cnt << endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'n' was not declared in this scope
    7 |   vector<int> a(n);
      |                 ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<tuple>
#include<utility>

using namespace std;

typedef long long int64;

int main(void){
    int64 N;
    cin>>N;
    int64 ans=0;
    vector<pair<int64,int64>> A(N);
    for(int64 i=0;i<N;i++){
        cin>>A[i].first;
        A[i].second=i;
    }

    sort(A.begin(),A.end());

    for(int64 i=1;i<N;i++){
        flag=false;
        for(int64 j=1;j<i;j++){
            if(A[i].second<A[j].second){
                flag=true;
                break;
            }
        }
        if(flag==true) ans++;
    }

    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: 'flag' was not declared in this scope
   24 |         flag=false;
      |         ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,ll> P;
#define M 1000000007
int main(){
  int n,c=0,m=-1,a;
  cin>>n;
  vector<int> b;
  for(int i=0;i<n;i++){
    cin>>a;
    if(i==0) b.push_back(a);
    else{
      if(b[b.size()-1]<a)b[b.size()-1]=a;
      else if(b[0]>=a){
        b.push_back(a);
        sort(b.begin(),b.end());
      }else{
        b[lower_bound(a.begin(),a.end(),a)-a.begin()-1]=a;
      }
    }
  }
  cout<<b.size();
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:25: error: request for member 'begin' in 'a', which is of non-class type 'int'
   19 |         b[lower_bound(a.begin(),a.end(),a)-a.begin()-1]=a;
      |                         ^~~~~
a.cc:19:35: error: request for member 'end' in 'a', which is of non-class type 'int'
   19 |         b[lower_bound(a.begin(),a.end(),a)-a.begin()-1]=a;
      |                                   ^~~
a.cc:19:46: error: request for member 'begin' in 'a', which is of non-class type 'int'
   19 |         b[lower_bound(a.begin(),a.end(),a)-a.begin()-1]=a;
      |                                              ^~~~~
Language: C++

#include <iostream>
using namespace std;

int dp[100005], a[100005], n;
int LIS_nlgn() {
  int len = 1;
  dp[1] = a[1];
  for (int i = 2; i <= n; ++i) {
    if (a[i] >= dp[len]) {
      dp[++len] = a[i];
    } else {
      int pos = upper_bound(dp, dp + len, a[i]) - dp;
      dp[pos] = a[i];
    }
  }
  return len;
}
int main() {
  cin >> n;
  for (int i = n; i >= 1; i--) {
    cin >> a[i];
  }
  cout << LIS_nlgn() << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int LIS_nlgn()':
a.cc:12:17: error: 'upper_bound' was not declared in this scope
   12 |       int pos = upper_bound(dp, dp + len, a[i]) - dp;
      |                 ^~~~~~~~~~~
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector> 
#include<limits>
#include<numeric>
#include<type_traits>
#include<math.h>
#include<fstream>
#include<set>
using namespace std;
typedef long long ll;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#define out(str) cout << str << endl
#define ALL(a) (a).begin(),(a).end()
#define INF (1<<29)

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int N;
vector<int> ans;

int main(){
    cin>>N;
    int A[N];
    rep(i,N)cin>>A[i];
    ans.push_back(A[0]);
    repi(i,1,N){
        auto it = lower_bound(ALL(ans),A[i]);
        auto be = ans.begin();
        if(it==be){
            ans.push_front(A[i]);
        }
        else{
            ans[it-be-1]=A[i];
        }
    }
    out(ans.size());


    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:17: error: 'class std::vector<int>' has no member named 'push_front'
   37 |             ans.push_front(A[i]);
      |                 ^~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;

int main()
{
    int n;
    cin >> n;
    int a[100002];
    for(int i = n - 1; i >= 0; i--) cin >> a[i];
    int dp[100002];
    fill(dp, dp + n, 1000000);
    for(int i = 0; i < n; i++){
        *upper_bound(dp, dp + n, a[i]) = a[i];
    }
    cout << upper_bound(dp, dp + n, 1000000 - 1) - dp << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: 'upper_bound' was not declared in this scope
   13 |         *upper_bound(dp, dp + n, a[i]) = a[i];
      |          ^~~~~~~~~~~
a.cc:15:13: error: 'upper_bound' was not declared in this scope
   15 |     cout << upper_bound(dp, dp + n, 1000000 - 1) - dp << endl;
      |             ^~~~~~~~~~~
Language: C++

#include<iostream>

typedef unsigned long long ULL;
using namespace std;

int main(){
    int N;
    ULL *a;
    ULL *color;
    int num_of_color;
    int i,j;
    cin >> N;
    a = new ULL[N];
    color = new ULL[N];
    for(i=0;i<N;i++){
        cin >> a[i];
    }
    color[0] = a[0];
    num_of_color = 1;
    for(i=1;i<N;i++){
        if( color[0] >= a[i]){
            color[num_of_color++] = a[i];
        }else{
            for(j=num_of_color-1;j>=0;j--){
                if( color[j] < a[i])
                    break;
            }
            color[j] = a[i];
        }
        sort(color,color+num_of_color);
    }
    cout << num_of_color << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   30 |         sort(color,color+num_of_color);
      |         ^~~~
      |         short
Language: Java

import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map.Entry;

import java.util.PriorityQueue;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class Main {
	
	public static void main(String[] args) throws IOException {
		try(final Scanner sc = new Scanner(System.in)){
			final int N = sc.nextInt();
			
			long[] array = new long[N];
			for(int i = 0; i < N; i++) {
				array[i] = sc.nextLong();
			}
			
			int count = 0;
			LinkedList<Integer> values = new LinkedList<Integer>();
			for(int i = 0; i < N; i++){ values.add(array[i]); }
			
			LinkedList<Integer> stack = new LinkedList<Integer>();
			LinkedList<Integer> answer = new LinkedList<Integer>();
			
			boolean[] used = new boolean[N];
			while(true) {
				boolean found = false;
				int size = 0;
				
				stack.clear();
				answer.clear();
				
				for(int i = 0; i < N; i++) {
					if(used[i]) { continue; }
					size++;
					
					while(!stack.isEmpty()) {
						final long value = array[stack.getLast()];
						if(array[i] <= value) { stack.removeLast(); }
						else { break; }
					}
					stack.addLast(i);
					
					if(answer.size() < stack.size()) {
						found = true;
						answer = new LinkedList<Integer>(stack);
					}
				}
				
				if(!found) { break; }
				
				for(final int index : answer) { used[index] = true; }
				count += 1;
			}
			
			System.out.println(count);
			
		}
	}

	public static class Scanner implements Closeable {
		private BufferedReader br;
		private StringTokenizer tok;

		public Scanner(InputStream is) throws IOException {
			br = new BufferedReader(new InputStreamReader(is));
		}

		private void getLine() throws IOException {
			while(!hasNext()){
				tok = new StringTokenizer(br.readLine());
			}
		}

		private boolean hasNext() {
			return tok != null && tok.hasMoreTokens();
		}

		public String next() throws IOException {
			getLine();
			return tok.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public int[] nextIntArray(int n) throws IOException {
			final int[] ret = new int[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextInt();
			}
			return ret;
		}

		public long[] nextLongArray(int n) throws IOException {
			final long[] ret = new long[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextLong();
			}
			return ret;
		}

		public void close() throws IOException {
			br.close();
		}
	}
}

Compiler output:
Main.java:30: error: incompatible types: long cannot be converted to Integer
			for(int i = 0; i < N; i++){ values.add(array[i]); }
			                                            ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: Java

import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;

public class E {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        long[] a = new long[n];
        for (int i = 0; i < n; i++) {
            a[i] = scan.nextLong();
        }

        LinkedList<Long> list = new LinkedList<>();
        list.add(a[0]);
        for (int i = 1; i < n; i++) {
            if (list.peekFirst() >= a[i]) {
                list.add(0, a[i]);
            } else {
                int index = ub(list, a[i]) - 1;
                list.set(index, a[i]);
            }
        }
        System.out.println(list.size());
    }

    static int ub(List<Long> arr, long x) {
        int ok = arr.size();
        int ng = -1;
        while (Math.abs(ok - ng) > 1) {
            int mid = (ok + ng) / 2;
            if (arr.get(mid) > x) {
                ok = mid;
            } else {
                ng = mid;
            }
        }
        return ok;
    }
}


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

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


int main() {
    int N; cin >> N;
    vector<int> a;
    for (int i = 0; i < N; ++i) {
        int aa; cin >> aa;
        a.push_back(aa);
    }

    multiset<long long> se;
    for (auto ai : a) {
        if (se.size() and ai < *begin(se)) se.insert(ai);
        else{
//            *(se.upper_bound(ai)-1) = ai
            auto it = se.lower_bound(ai);
            --it;
            *it = ai
    }
    cout << se.size() << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:17: error: assignment of read-only location 'it.std::_Rb_tree_const_iterator<long long int>::operator*()'
   23 |             *it = ai
      |             ~~~~^~~~
a.cc:26:2: error: expected '}' at end of input
   26 | }
      |  ^
a.cc:8:12: note: to match this '{'
    8 | int main() {
      |            ^
Language: C++

#include<iostream>
using namespace std;
void main(){
int a;
cin >> a;
int b[a],cnt=0;
bool c[a];
for(int i=0;i<a;i++){
  cin >> b[i];
  c[i] = false;
}
  for(int i=0;i<a;i++){
    int s = 1;
    for(int j=a-1;j>=0;){
      if(j-s<0)break;
      if(b[j]>=b[j-s] && b[j-s]==false && b[j]==false){
        s++;
      }else{
        c[j] = true;
        j = s;
        
      }
    }
    cnt++;
  }
  
cout << cnt << endl;


}

Compiler output:
a.cc:3:1: error: '::main' must return 'int'
    3 | void main(){
      | ^~~~
Language: C++

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

using ll = long long;
const int N = 1e5+10;
const int oo = 2e9;
int n, a[N], dp[N];

int main() {
	scanf("%d", &n);
	for(int i = 1; i <= n; i++) {
		scanf("%d", &a[i]);
		a[i] = -a[i];
	}
	for(int i = 1; i <= n; i++) {
		auto it = upper_bound(dp.begin(), dp.end(), a[i]);
		if(it == dp.end()) dp.push_back(a[i]);
		else dp[it - dp.begin()] = a[i];
	}
	printf("%d\n", (int)dp.size());
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:42: error: request for member 'begin' in 'dp', which is of non-class type 'int [100010]'
   16 |                 auto it = upper_bound(dp.begin(), dp.end(), a[i]);
      |                                          ^~~~~
a.cc:16:54: error: request for member 'end' in 'dp', which is of non-class type 'int [100010]'
   16 |                 auto it = upper_bound(dp.begin(), dp.end(), a[i]);
      |                                                      ^~~
a.cc:17:29: error: request for member 'end' in 'dp', which is of non-class type 'int [100010]'
   17 |                 if(it == dp.end()) dp.push_back(a[i]);
      |                             ^~~
a.cc:17:39: error: request for member 'push_back' in 'dp', which is of non-class type 'int [100010]'
   17 |                 if(it == dp.end()) dp.push_back(a[i]);
      |                                       ^~~~~~~~~
a.cc:18:33: error: request for member 'begin' in 'dp', which is of non-class type 'int [100010]'
   18 |                 else dp[it - dp.begin()] = a[i];
      |                                 ^~~~~
a.cc:20:32: error: request for member 'size' in 'dp', which is of non-class type 'int [100010]'
   20 |         printf("%d\n", (int)dp.size());
      |                                ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x)+modulo)%modulo)
#define Inf 100000000

int dp[2][51][5001];

int main() {
	
	int N,K;
	cin>>N>>K;
	
	dp[0][0][0][2500] = 1;
	
	for(int i=0;i<N;i++){
		for(int j=0;j<=N;j++){
			for(int v=0;v<=5000;v++){
				if(dp[0][j][v]==0)continue;
				
				dp[1][j][v] = mod(dp[0][j][v] + dp[1][j][v]);
				
				if(j!=N){
					dp[1][j+1][v-2*(i+1)] = mod(dp[1][j+1][v-2*(i+1)] + dp[0][j][v]);
				}
				
				if(j!=0){
					dp[1][j-1][v+2*(i+1)] = mod(dp[1][j-1][v+2*(i+1)] + mod(j*j*dp[0][j][v]));
				}
				
				dp[1][j][v] = mod(dp[1][j][v] + mod(dp[0][j][v] * j*2));
			}
		}
		swap(dp[0],dp[1]);
		for(int j=0;j<=N;j++){
				for(int v=0;v<=5000;v++){
					dp[1][j][v]=0;
				}
		}
	}
	
	cout<<dp[0][0][K+2500]<<endl;
	
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:20: error: invalid types 'int[int]' for array subscript
   14 |         dp[0][0][0][2500] = 1;
      |                    ^
Language: C++

#define DEBUGGING
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ALL(V) (V).begin(), (V).end()
#define ALLR(V) (V).rbegin(), (V).rend()

template <typename T> using V = vector<T>;
template <typename T> using VV = V<V<T>>;
using ll = int64_t;
using ull = uint64_t;
using PLL = pair<ll, ll>;

template <typename T> const T& var_min(const T &t) { return t; }
template <typename T> const T& var_max(const T &t) { return t; }
template <typename T, typename... Tail> const T& var_min(const T &t, const Tail&... tail) { return min(t, var_min(tail...)); }
template <typename T, typename... Tail> const T& var_max(const T &t, const Tail&... tail) { return max(t, var_max(tail...)); }
template <typename T, typename... Tail> void chmin(T &t, const Tail&... tail) { t = var_min(t, tail...); }
template <typename T, typename... Tail> void chmax(T &t, const Tail&... tail) { t = var_max(t, tail...); }
template <typename T> const T& clamp(const T &t, const T &low, const T &high) { return max(low, min(high, t)); }
template <typename T> void chclamp(T &t, const T &low, const T &high) { t = clamp(t, low, high); }

namespace init__ {

struct InitIO {
    InitIO() {
        cin.tie(nullptr);
        ios_base::sync_with_stdio(false);
        cout << fixed << setprecision(30);
    }
} init_io;

}

#ifdef DEBUGGING
// #include "../debug/debug.cpp"
#include "../../debug/debug.cpp"
#else
#define DEBUG(...) 0
#define DEBUG_SEPARATOR_LINE 0
#endif

template <typename T>
T make_v(T init) { return init; }

template <typename T, typename... Tail>
auto make_v(T init, size_t s, Tail... tail) {
#define rec make_v(init, tail...)
    return V<decltype(rec)>(s, rec);
#undef rec
}

const ll max_sum = 50 * (50 - 1) / 2;

ll dp[51][2 * (max_sum + 5)];
ll dp_sub[51][2 * (max_sum + 5)];

ll make_idx(ll sum) { return sum + max_sum + 1; }

const ll mod = 1e9 + 7;

int main() {
    ll N, K;
    cin >> N >> K;
    dp[0][make_idx(0)] = 1;
    for(ll i = 1; i <= N; i++) {
        for(ll j = 0; j < 51; j++) for(ll k = -max_sum; k <= max_sum; k++) dp_sub[j][make_idx(k)] = 0;
        for(ll j = 0; j < i; j++) for(ll k = -max_sum; k <= max_sum; k++) {
            ll cur_k_idx = make_idx(k);
            (dp_sub[j][cur_k_idx] += dp[j][cur_k_idx]) %= mod; // i <-> i
            (dp_sub[j + 1][make_idx(k - i * 2)] += dp[j][cur_k_idx]) %= mod; // hold
            if(1 <= j) {
                (dp_sub[j][cur_k_idx] += 2 * j * dp[j][cur_k_idx]) %= mod; // only one
                (dp_sub[j - 1][make_idx(k + 2 * i)] += j * j * dp[j][cur_k_idx]) %= mod; // both
            }
        }
        swap(dp, dp_sub);
    }
    cout << dp[0][make_idx(K)] << endl;
    return 0;
}


Compiler output:
a.cc:37:10: fatal error: ../../debug/debug.cpp: No such file or directory
   37 | #include "../../debug/debug.cpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;
import java.io.*;

public class PermutationOddness {
    static final long MOD = 100000007L;
    public static void main(String[] args) {
        FastScanner scanner = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
        int N = scanner.nextInt();
        int K = scanner.nextInt();
        long[][][] dp = new long[N+1][N+1][2605];
        dp[0][0][0] = 1;
        for(int i= 0; i <N; i++) {
            for(int j = 0; j <= i; j++) {
                for(int k = 0; k <= K; k++) {
                    if (dp[i][j][k] == 0) continue;
                    //close previously opened segment
                    if (j > 0 && k + j * 2 <= K) {
                        dp[i+1][j][k + j * 2] = (dp[i+1][j][k+j*2] + dp[i][j][k] * 2 * j) % MOD;
                    }
                    //base of putting self
                    dp[i+1][j][k+j*2] = (dp[i+1][j][k+j*2] + dp[i][j][k]) %MOD;
                    //close with cur already set
                    if (j> 0 && k + (j-1)*2 <= K) {
                        dp[i+1][j-1][k+(j-1)*2] = (dp[i+1][j-1][k+(j-1)*2] + dp[i][j][k] * j * j) % MOD;
                    }
                    //open new
                    if (k + (j+1)*2 <= K) {
                        dp[i+1][j+1][k+(j+1)*2] = (dp[i+1][j+1][k+(j+1)*2] + dp[i][j][k]) % MOD;
                    }
                }
            }
        }
        out.println(dp[N][0][K]);
        out.flush();
    }
    
    public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;
        
        public FastScanner(Reader in) {
            br = new BufferedReader(in);
        }
        
        public FastScanner() {
            this(new InputStreamReader(System.in));
        }
        
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        
        int nextInt() {
            return Integer.parseInt(next());
        }
        
        long nextLong() {
            return Long.parseLong(next());
        }
        
        double nextDouble() {
            return Double.parseDouble(next());
        }
        
        String readNextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}


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

import itertools
n, k = map(int, input().split())
list1 = list(itertools.permutations([i for i in range(1,n+1)]))
count = 0
for tup in list1:
	sum = 0
	for i,v in enumerate(tup):
		sum += abs(i+1-v)
	if sum == k:
#		print(tup)
		count=(count+1)%(1e9+7)

print(count)

Compiler output:
a.cc:10:17: error: invalid preprocessing directive #print
   10 | #               print(tup)
      |                 ^~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import itertools
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N=55,M=1e9+7,Z=3000;
int n,k,dp[N][N][N*N<<1];
void ck(int &x){
	if(x>=M)x-=M;
}
int main(){
	scanf("%lld %lld",&n,&k);
	if(k&1||k>(n*n>>1)){
		puts("0");
		return 0;
	}
	dp[0][0][Z]=1;
	for(int i=0;i<n;++i){
		for(int o=0;o<=i;++o){
			for(int u=0;u<=5055;++u){
				if(!dp[i][o][u])continue;
				dp[i+1][o][u]+=dp[i][o][u];ck(dp[i+1][o][u]);
				dp[i+1][o][u]+=1ll*dp[i][o][u]*o%M;ck(dp[i+1][o][u]);
				dp[i+1][o][u]+=1ll*dp[i][o][u]*o%M;ck(dp[i+1][o][u]);
				dp[i+1][o+1][u-2*i]+=dp[i][o][u];ck(dp[i+1][o+1][u-2*i]);
				if(u)dp[i+1][o-1][u+2*i]+=1ll*dp[i][o][u]*o*o%M;ck(dp[i+1][o+1][u-2*i]);
			}
		}
	}
	printf("%lld\n",dp[n][0][Z+k]);
}

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

#include <stdio.h>

const int MOD = 1e9+7;

int n, k, ans;
int dp[55][2505][55];
// dp[i][j][p] signifies that we are processing i,
// have made j oddness, and there's still p empty spaces.

int main(int argc, char const *argv[])
{
    scanf("%d%d", &n, &k);
    if (k > n * n / 2)
    {
        printf("0\n");
        return 0;
    }
    dp[0][1251][0] = 1;
    for (int i = 1; i <= n; ++i)
        for (int j = 0; j < 2505; ++j)
            for (int p = 0; p < i; ++p)
            {
                int current = dp[i - 1][j][p];
                int &next0  = dp[i][j][p];
                next0       = (next0 + (long long)current * (p * 2 + 1)) % MOD;
                int &next1  = dp[i][j - i * 2][p + 1];
                next1       = (next1 + current) % MOD;

                if (p == 0) continue;
                int &next2  = dp[i][j + i * 2][p - 1];
                next2       = (next2 + (long long)current * p * p % MOD) % MOD;
            }
    printf("%d\n", dp[n][k + 1251][0]);
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:24:21: error: expected identifier or '(' before '&' token
   24 |                 int &next0  = dp[i][j][p];
      |                     ^
main.c:25:17: error: 'next0' undeclared (first use in this function)
   25 |                 next0       = (next0 + (long long)current * (p * 2 + 1)) % MOD;
      |                 ^~~~~
main.c:25:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:26:21: error: expected identifier or '(' before '&' token
   26 |                 int &next1  = dp[i][j - i * 2][p + 1];
      |                     ^
main.c:27:17: error: 'next1' undeclared (first use in this function)
   27 |                 next1       = (next1 + current) % MOD;
      |                 ^~~~~
main.c:30:21: error: expected identifier or '(' before '&' token
   30 |                 int &next2  = dp[i][j + i * 2][p - 1];
      |                     ^
main.c:31:17: error: 'next2' undeclared (first use in this function)
   31 |                 next2       = (next2 + (long long)current * p * p % MOD) % MOD;
      |                 ^~~~~
Language: C++

// template version 1.12
using namespace std;
#include <iostream>
#include <bits/stdc++.h>

// varibable settings
#define infile "../test/sample-1.in"
#define int long long //{{{
const int INF=1e18;
const int MOD=1e9+7; //}}}

// define basic macro {{{
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define _rrep(i,n) rrepi(i,0,n)
#define rrepi(i,a,b) for(int i=(int)((b)-1);i>=(int)(a);--i)
#define rrep(...) _overload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)
#define each(i,a) for (auto&& i : a)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define uni(x) sort(all(x));x.erase(unique(all(x)),x.end())
#define ub upper_bound
#define lb lower_bound
#define posl(A, x) (lower_bound(all(A), x)-A.begin())
#define posu(A, x) (upper_bound(all(A),x)-A.begin())
template<class T> inline void chmax(T &a, const T &b) { if((a) < (b)) (a) = (b); }
template<class T> inline void chmin(T &a, const T &b) { if((a) > (b)) (a) = (b); }

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long double ld;
typedef pair<int,int> pii;
typedef tuple<int,int,int> iii;

template<typename T> using PQ = priority_queue<T, vector<T>, greater<T>>;
struct Fast { Fast(){ std::cin.tie(0); ios::sync_with_stdio(false); } } fast;

#if defined(PCM) || defined(LOCAL)
  #include "lib/dump.hpp"
#else
  #define dump(...) 42
  #define dump_1d(...) 42
  #define dump_2d(...) 42
#endif
//}}}

int solve(){
  int N,K;cin>>N>>K;

  if (K%2==1){
    cout << 0 << endl;
    return 0;
  }

  // dp[n][逆転してる個数][i==p[i]の個数]でdp
  assert(k>=1000);


  return 0;
}

signed main() { //{{{
#ifdef INPUT_FROM_FILE
  std::ifstream in(infile);
  std::cin.rdbuf(in.rdbuf());
#endif
  solve();
  return 0;
} //}}}


Compiler output:
In file included from /usr/include/c++/14/cassert:44,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:106,
                 from a.cc:4:
a.cc: In function 'long long int solve()':
a.cc:61:10: error: 'k' was not declared in this scope
   61 |   assert(k>=1000);
      |          ^
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef pair<ll, ll> LP;
typedef vector<LP> vec;
typedef vector<string> svec;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-8;

const int sz = 2600;
ll dp[sz][51];
ll cop[sz][51];
void solve() {
	int n, x; cin >> n >> x;
	if (x % 2) {
		cout << 0 << endl; return;
	}
	dp[sz/2][0] = 1;
	rep(i, n) {
		rep(j, sz)rep(k, n + 1)cop[j][k] = 0;
		rep(j, sz) {
			rep(k, i+1) {
					if (dp[j][k] == 0)continue;
					//
					(cop[j][k] += dp[j][k]) %= mod;
					//
					(cop[j][k] += dp[j][k]*k) %= mod;
					//
					if (k > 0&&l>0) {
						(cop[j + i][k - 1] += dp[j][k] * k*k) %= mod;
					}
					//
					(cop[j - i][k + 1] += dp[j][k]) %= mod;
					//
					(cop[j][k] += dp[j][k] * k) %= mod;
			}
		}
		rep(j, sz)rep(k, n + 1)rep(l,n+1)dp[j][k] = cop[j][k];
	
	}
	if (x / 2 + sz / 2 >= sz) {
		cout << 0 << endl; return;
	}
	//cout << "hello" << endl;
	cout << dp[x / 2 + sz / 2][0] << endl;
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	//cout << fixed << setprecision(10);
	//init();
	solve();
	//stop
		return 0;
}



Compiler output:
a.cc: In function 'void solve()':
a.cc:61:52: error: 'l' was not declared in this scope
   61 |                                         if (k > 0&&l>0) {
      |                                                    ^
Language: C++

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




int main(){
    int N;

    cin >> N;
    std::vector<int> seq(N,0);
    for(int i=0; i < N; i++){
        cin >> seq.at(i);
    }
    std::vector<int> num_seq(N, -1);
    int prev = seq.at(0);
    int res = 0;
    for (int var : seq){
        for(int i=0; i < N; i++){
            if(num_seq.at(i) < var){
                num_seq.at(i) = var;
                if(res<i) res = i;
                break;
            }
        }
    }

    // for(int i=0; i < N; i++){
    //     // cout << num_seq.at(i) << endl;
    //     if(num_seq.at(i) == -1){
    //         cout << i << endl;
    //         return 0;
    //     }
    // }
    cout << i + 1 << endl;
    return 0;


}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:13: error: 'i' was not declared in this scope
   35 |     cout << i + 1 << endl;
      |             ^
Language: C++

#include<bits/std++.h>
using namespace std;
int main()
{
  int a;
  cin>>a;
  int a-1=b;
  cin>>b;
  int a-2=c;
  cin>>c;
  cout<<a;
  cout<<b;
  cout<<c;
  cout<<a*b;
  cout<<a*c;
  cout<<b*c;
  return 0;
}

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

#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#include <bits/stdc++.h>
using namespace std;
template<class t> inline t read(t &x){
	char c=getchar();bool f=0;x=0;
	while(!isdigit(c)) f|=c=='-',c=getchar();
	while(isdigit(c)) x=(x<<1)+(x<<3)+(c^48),c=getchar();
	if(f) x=-x;return x;
}
template<class t,class ...A> inline void read(t &x,A &...a){
	read(x);read(a...);
}
template<class t> inline void write(t x){
	if(x<0) putchar('-'),write(-x);
	else{if(x>9) write(x/10);putchar('0'+x%10);}
}

const int N=2e5+5;
int a[N],m,cnt[N],n,b[5];

void GG(){
	puts("No");
	exit(0);
}

void OK(){
	puts("Yes");
	exit(0);
}

signed main(){
	read(n);
	for(int i=1;i<=n;i++) read(a[i]);
	sort(a+1,a+1+n);
	a[0]=-1;
	for(int i=1;i<=n;i++) a[i]==a[i-1]?cnt[m]++:cnt[++m]++;
	if(m>3) GG();
	m=0;for(int i=1;i<=n;i++) if(a[i]!=a[i-1]) b[++m]=a[i];
	if(m==1&&!b[1]) OK();
	if(m<3||n%3) GG();
	if(cnt[1]!=n/3||cnt[2]!=n/3||cnt[3]!=n/3) GG();
//	printf("#%d %d %d %d %d %d\n",b[1],b[2],b[3],b[1]^b[2],b[2]^b[3],b[1]^b[3]);
	if((b[1]^b[2])==b[3]) OK();
	if((b[1]^b[3])==b[2]) OK();
	if((b[2]^b[3])==b[1]) OK();a
	GG();
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:37: error: expected ';' before 'GG'
   45 |         if((b[2]^b[3])==b[1]) OK();a
      |                                     ^
      |                                     ;
   46 |         GG();
      |         ~~
Language: C++

#include<algorithm>
#include<bitset>
#include<cmath>
#include<complex>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<iterator>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<utility>
#include<vector>
#include<chroNo>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,x,n) for(int i=x; i<(n); i++)
#define vint(a,n) vint a(n); rep(i, n) cin >> a[i];
#define vll(a,n) vll a(n); rep(i, n) cin >> a[i];
#define ALL(n) begin(n),end(n)
#define RALL(n) rbegin(n),rend(n)
#define MOD (1000000007)
// #define MOD (998244353)
#define INF (2e9)
#define INFL (2e18)

typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;
using vint=vector<int>;
using vll=vector<ll>;
using vbool=vector<bool>;
template<class T>using arr=vector<vector<T>>;
template<class T>int popcount(T &a){int c=0; rep(i, 8*(int)sizeof(a)){if((a>>i)&1) c++;} return c;}
template<class T>void pr(T x){cout << x << endl;}
template<class T>void prvec(vector<T>& a){rep(i, a.size()-1){cout << a[i] << " ";} pr(a[a.size()-1]);}
template<class T>void prarr(arr<T>& a){rep(i, a.size()) if(a[i].empty()) pr(""); else prvec(a[i]);}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main()
{
    int n; cin >> n;
    int z = 0;
    map<int, int> m;
    vint a(n);
    rep(i, n){
        cin >> a[i];
        if(a[i]==0) z++;
        m[a[i]]++;
    }

    if(z==n) {pr("Yes"); return 0;}

    if(z > 0){
        if(m.size()>2) pr("No");
        else pr("Yes");
        return 0;
    }

    if(m.size()!=3) {pr("No"); return 0;}

    vint b, c;
    for(auto p: m) {
        c.push_back(p.second);
        b.push_back(p.first);
    }
    if(c[0]!=c[1] || c[1]!=c[2]) {pr("No"); return 0;}
    if(b[0] ^ b[1] == b[2]) pr("Yes");
    else pr("No");
    return 0;}

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

#include<algorithm>
#include<bitset>
#include<cmath>
#include<complex>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<iterator>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<uNordered_map>
#include<uNordered_set>
#include<utility>
#include<vector>
#include<chroNo>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,x,n) for(int i=x; i<(n); i++)
#define vint(a,n) vint a(n); rep(i, n) cin >> a[i];
#define vll(a,n) vll a(n); rep(i, n) cin >> a[i];
#define ALL(n) begin(n),end(n)
#define RALL(n) rbegin(n),rend(n)
#define MOD (1000000007)
// #define MOD (998244353)
#define INF (2e9)
#define INFL (2e18)

typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;
using vint=vector<int>;
using vll=vector<ll>;
using vbool=vector<bool>;
template<class T>using arr=vector<vector<T>>;
template<class T>int popcount(T &a){int c=0; rep(i, 8*(int)sizeof(a)){if((a>>i)&1) c++;} return c;}
template<class T>void pr(T x){cout << x << endl;}
template<class T>void prvec(vector<T>& a){rep(i, a.size()-1){cout << a[i] << " ";} pr(a[a.size()-1]);}
template<class T>void prarr(arr<T>& a){rep(i, a.size()) if(a[i].empty()) pr(""); else prvec(a[i]);}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main()
{
    int n; cin >> n;
    int z = 0;
    map<int, int> m;
    vint a(n);
    rep(i, n){
        cin >> a[i];
        if(a[i]==0) z++;
        m[a[i]]++;
    }

    if(z==n) {pr("Yes"); return 0;}

    if(z > 0){
        if(m.size()>2) pr("No");
        else pr("Yes");
        return 0;
    }

    if(m.size()!=3) {pr("No"); return 0;}

    vint b, c;
    for(auto p: m) {
        c.push_back(p.second);
        b.push_back(p.first);
    }
    if(c[0]!=c[1] || c[1]!=c[2]) {pr("No"); return 0;}
    if(b[0] ^ b[1] == b[2]) pr("Yes");
    else pr("No");
    return 0;}

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

    #include<iostream>
    #include<stdio.h>
    //#include <bits/stdc++.h>
    #include<vector>
    #include<float.h>
    #include<iomanip>
    #include<algorithm>
    #include<string>
    #include<cstring>
    #include<math.h>
    #include<cmath>
    #include<sstream>
    #include<set>
    #include<map>
    #include<queue>
    #include<cassert>
    #include<cmath>
    #include<cstdint>
     
    #define INF 1e9
    #define rep(i,n)for(int i=0;(i)<(int)(n);i++)
    #define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
    #define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
    #define vec(type,n) vector<type>(n)
    #define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))
    #define ALL(a)  (a).begin(),(a).end()
    #define chmin(a, b) a = min(a, b)
    #define chmax(a, b) a = max(a, b)
    #define pb push_back
    #define sz size()
     
    using namespace std;
    using ll = long long int;
    using Graph = vector<vector<int>>;
    using P = pair<ll, ll>;
    using Vl = vector<ll>;
     
const int MOD = 1e9 + 7;
const ll ZER = 0;


int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    set<int> st;

    rep(i, n){
        cin >> a[i];
        st.insert(a[i]);
    }
    if(st.size() == 1){
        if(a[0] == 0)cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    if(st.size() == 2){
        int x = 0, z = 0;
        rep(i, n){
            if(a[i] == 0)z++;
            else x++;
        }
        if(n % 3 == 0 && x == n / 3 * 2 && z == n / 3)cout << "Yes" << endl;
        else cout << "No" << endl;
        //cout << "hoge";
    }
    if(st.size() == 3){
        bool f = true;
        rep(i, n){
            if(a[i] != a[(i + 3) % n]){
                f = false;
            }
        }
        if(f %% n % 3 == 0)cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    if(st.size() > 3)cout << "No" << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:73:15: error: expected primary-expression before '%' token
   73 |         if(f %% n % 3 == 0)cout << "Yes" << endl;
      |               ^
Language: C++

    #include<iostream>
    #include<stdio.h>
    //#include <bits/stdc++.h>
    #include<vector>
    #include<float.h>
    #include<iomanip>
    #include<algorithm>
    #include<string>
    #include<cstring>
    #include<math.h>
    #include<cmath>
    #include<sstream>
    #include<set>
    #include<map>
    #include<queue>
    #include<cassert>
    #include<cmath>
    #include<cstdint>
     
    #define INF 1e9
    #define rep(i,n)for(int i=0;(i)<(int)(n);i++)
    #define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
    #define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
    #define vec(type,n) vector<type>(n)
    #define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))
    #define ALL(a)  (a).begin(),(a).end()
    #define chmin(a, b) a = min(a, b)
    #define chmax(a, b) a = max(a, b)
    #define pb push_back
    #define sz size()
     
    using namespace std;
    using ll = long long int;
    using Graph = vector<vector<int>>;
    using P = pair<ll, ll>;
    using Vl = vector<ll>;
     
const int MOD = 1e9 + 7;
const ll ZER = 0;


int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    set<int> st;

    rep(i, n){
        cin >> a[i];
        st.insert(a[i]);
    }
    if(st.size() == 1){
        if(a[0] == 0)cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    if(st.size() == 2){
        int x = 0, z = 0;
        int aa[INF];
        rep(i, n){
            if(a[i] == 0)z++;
            else x++;
        }
        if(n % 3 == 0 && x == n / 3 * 2 && z == n / 3)cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    if(st.size() == 3){
        rep(i, n){
            if(a[i] != a[(i + 3) % n]){
                cout << "No" << endl;
                return 0;
            }
        }
        cout << "Yes" << endl;
    }
    if(st.size() > 3)cout << "No" << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
   20 |     #define INF 1e9
      |                 ^~~
a.cc:58:16: note: in expansion of macro 'INF'
   58 |         int aa[INF];
      |                ^~~
a.cc:20:17: error: could not convert '1.0e+9' from 'double' to 'long unsigned int'
   20 |     #define INF 1e9
      |                 ^~~
      |                 |
      |                 double
a.cc:58:16: note: in expansion of macro 'INF'
   58 |         int aa[INF];
      |                ^~~
a.cc:20:17: error: size of array 'aa' has non-integral type 'double'
   20 |     #define INF 1e9
      |                 ^~~
a.cc:58:16: note: in expansion of macro 'INF'
   58 |         int aa[INF];
      |                ^~~
Language: C++

    #include<iostream>
    #include<stdio.h>
    //#include <bits/stdc++.h>
    #include<vector>
    #include<float.h>
    #include<iomanip>
    #include<algorithm>
    #include<string>
    #include<cstring>
    #include<math.h>
    #include<cmath>
    #include<sstream>
    #include<set>
    #include<map>
    #include<queue>
    #include<cassert>
    #include<cmath>
    #include<cstdint>
     
    #define INF 1e9
    #define rep(i,n)for(int i=0;(i)<(int)(n);i++)
    #define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
    #define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
    #define vec(type,n) vector<type>(n)
    #define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))
    #define ALL(a)  (a).begin(),(a).end()
    #define chmin(a, b) a = min(a, b)
    #define chmax(a, b) a = max(a, b)
     
    using namespace std;
    using ll = long long int;
    using Graph = vector<vector<int>>;
    using P = pair<ll, ll>;
     
const int MOD = 1e9 + 7;
const ll ZER = 0;


int main(){
    ll n;
    cin >> n;
    int cnt = 0;
    if(n == 3){
        while(1){
            cnt++;
        }
        if(cnt < 0)break;
    }
    else cout << "hoge" << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:47:20: error: break statement not within loop or switch
   47 |         if(cnt < 0)break;
      |                    ^~~~~
Language: C++

#include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;

#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

int main() {
  int res = 0;
  int in;
  int x, y, z;
  int c_x = 0;
  int c_y = 0;
  int c_z = 0;
  int c_zero = 0;
  int n;
  x = 0;
  y = 0;
  z = 0;
  cin >> n;
  REP(i, n) {
    cin >> in;
    if (in == 0) {
      ++c_zero;
    } else {
      if (x == 0 | x == in) {
        x = in;
        c_x++;
      } else if (y == 0 | y == in) {
        y = in;
        c_y++;
      } else if (z == 0 | z == in) {
        z = in;
        c_z++;
      } else {
        cout << "No" << endl;
        return
      }
    }
  }
  if (x == 0 && y == 0 && z == 0) {
    cout << "Yes" << endl;
  } else {
    if (3 * c_x == 2 * n && 3 * c_zero == n) {
      cout << "Yes" << endl;
    } else if (3 * c_x == n && 3 * c_y == n && 3 * c_z == n) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:7: error: expected primary-expression before '}' token
   45 |       }
      |       ^
a.cc:44:15: error: expected ';' before '}' token
   44 |         return
      |               ^
      |               ;
   45 |       }
      |       ~