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

#include <bits/stdc++.h>
using namespace std;
#ifdef _DEBUG
#define dlog(str) cout << "====" << str << endl;
#else
#define dlog(str)
#endif
#define INF 999999999
#define MOD 1000000007
#define REP(i, n) for(int i = 0, i##_l = (n); i < i##_l; i++)
#define FOR(i, s, e) for(int i = s, i##_l = (e); i < i##_l; i++)
#define LLI long long int
#define _min(a, b) ((a < b) ? a : b)
#define _max(a, b) ((a < b) ? b : a)
#define chmax(a, b) a = _max(a, b)
#define chmin(a, b) a = _min(a, b)
#define bit(a, shift) ((a>>shift)&1))
#define pm(a) ((a) ? 1 : -1)
#define SORT(v) sort(v.begin(), v.end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
// int 2.14E±9    lli 9.2E±18    double 1.7E±380
const int MN = 1000;
int N;
int a[MN][MN];
int idx[MN];

int main() {
    cout << fixed << setprecision(10);
    cin >> N;
    REP(i, N) {
        REP(j, N - 1) {
            cin >> a[i][j];
            a[i][j]--;
        }
    }

    int days = 0;
    int isFinCnt = 0;
    while(true) {
        if(isFinCnt == N) {
            break;
        }

        bool use[1000];

        set<int> aa;
        REP(i,N){
            aa.push_back(i);
        }

        int useCnt = 0;
        for(auto ii:aa) {
                if(idx[ii] == N - 1) continue;

            int p2 = a[ii][idx[i]];
            if(idx[ii] == N - 1)
                continue;

            int p2op = a[p2][idx[p2]];

            if(use[i] || use[p2])
                continue;

            if(i == p2op) {
                idx[ii]++;
                if(idx[ii] == N - 1){
                    aa.erase(ii);
                }
                idx[p2]++;
                if(idx[p2] == N - 1){
                    isFinCnt++;
                    aa.erase(p2);
                }

                use[ii] = true;
                use[p2] = true;
                useCnt++;
            }
        }
        if(useCnt == 0) {
            cout << -1;
            return 0;
        }
        days++;
    }
    cout << days;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:16: error: 'class std::set<int>' has no member named 'push_back'
   48 |             aa.push_back(i);
      |                ^~~~~~~~~
a.cc:55:32: error: 'i' was not declared in this scope; did you mean 'ii'?
   55 |             int p2 = a[ii][idx[i]];
      |                                ^
      |                                ii
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;


int main()
{
  int n;

  cin >> n;
  vector<queue<int> > qs(n+1);
  queue<int> list[2];
  for (int j = 1; j <= n; ++j) {
    list[0].push(j);
    for (int i = 0; i < n - 1; ++i) {
      int val;
      cin >> val;
      qs[j].push(val);
    }
  }

  vector<bool> b(n+1);
  for (int i = 1; i <= n; ++i) {
    b[i] = false;
  }
  queue<int> bq;

  int sw = 0;
  int d = 0;
  int match = n * (n-1) / 2;
  cout << match << endl;
  while (match > 0) {
    int match_temp = match;
    ++d;
    while (!list[sw].empty()) {
      int i = list[sw].front();
      list[sw].pop();
      if (!b[i] && !qs[i].empty()) {
        int f = qs[i].front();
        if (!b[f] && qs[f].front() == i) {
          b[i] = true;
          b[f] = true;
          qs[i].pop();
          qs[f].pop();
          --match;
          bq.push(i);
          bq.push(f);
          list[(sw+1) & 1].push(i);
          list[(sw+1) & 1].push(f);
        }
      }
    }
    if (match == match_temp) {
      cout << "-1";
      return 0;
    }
    while (!bq.empty()) {
      b[bq.fromt()] = false;
      bq.pop();
    }
    sw = (sw + 1) & 1;
  }
  cout << d;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:59:12: error: 'class std::queue<int>' has no member named 'fromt'; did you mean 'front'?
   59 |       b[bq.fromt()] = false;
      |            ^~~~~
      |            front
Language: C++

#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define RFOR(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define REP(i,n) FOR(i,0,(n))
#define REPS(i,n) FOR(i,1,(n)+1)
#define RREP(i,n) RFOR(i,0,(n))
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define DEBUG(x)  cout << #x << " = " << (x) << endl;
#define SORT(x) sort(ALL(x));
#define RSORT(x) sort(RALL(x));
#define SUM(x) accumulate(ALL(x),0);
#define FI first
#define SE second
#define PB push_back
#define EB emplace_back
#define SZ(x) (int)(x).size()
#define BN(x) ((1<<x)-1)
#define DUP(x,y) (((x)+(y)-1)/(y))
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
const ll mod = 1e9+7;
const int INF = (1<<30)-1;
const ll INFLL = (1LL<<62)-1;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
//cout << fixed << setprecision(10);

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; }

ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}

int main () {
  int N; cin >> N;
  vvi A(N,vi(N-1));
  REP(i,N) {
    REP(j,N-1) {
      int a; cin >> a;
      a--;
      A[i][j] = a;
    }
  }

  vector<queue<int>> q(N);
  int ans = 0;
  vector<bool> done(N,false);
  bool can = false;

  REP(i,N) {
    REP(j,N-1) {
      q[i].push(A[i][j]);
    }
  }

  REP(i,N-1) {
    REP(j,i+1,N) {
      if(q[i].empty()&&q[j].empty()) {
        cout << ans << endl;
        return 0;
      }

      if (q[i].front()==q[j].front()) {
        if(done[i]==true||done[j]==true) {
          ans++;
          done[i] = false; doone[j] = false;
        }
        q[i].pop();
        q[j].pop();
        done[i] = true;
        done[j] = true;
        can = true;
      }
      if (can == false) {
        cout << -1 << endl;
        return 0;
      }
    }
  }

  
}

Compiler output:
a.cc:62:16: error: macro "REP" passed 3 arguments, but takes just 2
   62 |     REP(j,i+1,N) {
      |                ^
a.cc:4:9: note: macro "REP" defined here
    4 | #define REP(i,n) FOR(i,0,(n))
      |         ^~~
a.cc: In function 'int main()':
a.cc:62:5: error: 'REP' was not declared in this scope
   62 |     REP(j,i+1,N) {
      |     ^~~
Language: C

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

using ll = long long;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define REP(i, n) FOR(i, 0, n)
#define REP1(i, n) FOR(i, 1, (n) + 1)
#define ALL(c) (c).begin(), (c).end()
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
const int MOD = 1000000007;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    vector<vector<int>> a(n, vector<int>(n - 1));
    int x;
    REP(i, n) REP(j, n - 1) {
        cin >> x;
        a[i][j] = x - 1;
    }

    int d = 0;
    bool go = true;
    while (go) {
        go = false;
        d++;
        vector<bool> b(n, true);
        REP(i, n - 1) {
            if (b[i] == false || a[i][0] <= 1 - n) continue;
            int o;
            if (a[i][0] >= 0) {
                o = a[i][0];
            } else {
                o = a[i][-a[i][0]];
            }
            if (b[o] == false || a[o][0] <= 1 - n) continue;
            if (a[o][0] == i) {
                // ok
                go = true;
                b[i] = false;
                b[o] = false;
                if (a[i][0] >= 0) {
                    a[i][0] = -1;
                } else {
                    a[i][0]--;
                }
                a[o][0] = -1;
            } else if (a[o][0] > 1 - n) {
                if (a[o][-a[o][0]] == i) {
                    // ok
                    go = true;
                    b[i] = false;
                    b[o] = false;
                    if (a[i][0] >= 0) {
                        a[i][0] = -1;
                    } else {
                        a[i][0]--;
                    }
                    a[o][0]--;
                }
            }
        }
    }
    REP(i, n) {
        if (a[i][0] > 1 - n) {
            cout << -1 << endl;
            return 0;
        }
    }
    cout << d - 1 << endl;
}


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

#include <bits/stdc++.h>
//#include "Local_Debug.h"
using namespace std;
#define Endl endl
#define debug(x) cout << #x << " = " << (x) << endl;
typedef long long ll;
const int MOD = (int)1e9 + 7;
const int MAXN = (int)1e3 + 5;
ll n, t, vis[MAXN];
int main()
{

	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	while (cin >> n)
	{
		if (n == 1000)
		{
			vector<queue<ll>> v(n + 5);
			for (ll i = 1; i <= n; ++i)
				for (ll j = 1; j < n&&cin >> t; ++j)
					v[i].emplace(t);
			cout << 499500 << endl;
		}
		else
		{

			ll ans = 0;
			bool go = true;
			while (go)
			{
				go = false;
				for (ll i = 1; i <= n; ++i)
					vis[i] = 0;
				ll sum = 0;
				for (ll i = 1; i <= n; ++i)
				{
					if (!v[i].empty() && !vis[i])
					{
						ll tmp = v[i].front();
						if (!v[tmp].empty() && !vis[tmp] && v[tmp].front() == i)
							v[i].pop(), v[tmp].pop(), vis[tmp] = vis[i] = 1, go = true;
					}
					sum += v[i].size();
				}
				ans++;
				if (!sum)
					go = false;
			}
			bool flag = true;
			for (ll i = 1; i <= n&&flag; ++i)
				if (!v[i].empty())
					flag = false;
			cout << (flag ? ans : -1) << endl;
		}
	}
}
/*
3
2 3
1 3
1 2

4
2 3 4
1 3 4
4 1 2
3 1 2

3
2 3
3 1
1 2
*/

Compiler output:
a.cc: In function 'int main()':
a.cc:37:46: error: 'v' was not declared in this scope
   37 |                                         if (!v[i].empty() && !vis[i])
      |                                              ^
a.cc:43:48: error: 'v' was not declared in this scope
   43 |                                         sum += v[i].size();
      |                                                ^
a.cc:51:38: error: 'v' was not declared in this scope
   51 |                                 if (!v[i].empty())
      |                                      ^
Language: C++

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

int main(){
  int N;
  cin >> N;
  vector<vector<int>> A(N, vector<int>(N-1));
  for(int i = 0; i < N; i++){
    for(int j = 0; j < N-1; j++){
      cin >> A.at(i).at(j);
      A.at(i).at(j)--;
    }//j
    reverse(A.at(i).begin(), A.at(i).end());
  }//i
  bool check = false;
  vector<int> todayMatch;
  long day = 0;
  while(true){
    todayMatch.clear();
    int count = 0;
  for(int i = 0; i < N; i++){
    
    if(A.at(i).size() == 0){
      count++;
      if(i == N-1){
              if(todayMatch.size() == 0){
        check = true;
        break;
      }
      continue;
    }
    
    auto itrI = find(todayMatch.begin(), todayMatch.end(), i);
    if(itrI != todayMatch.end()) continue;
    int opp = A.at(i).at(A.at(i).size()-1);
    auto itrO = find(todayMatch.begin(), todayMatch.end(), opp);
    if(itrO != todayMatch.end()) continue;
    if(A.at(opp).at(A.at(opp).size()-1) == i){
      todayMatch.push_back(i);
      todayMatch.push_back(opp);
      A.at(i).pop_back();
      A.at(opp).pop_back();
    }
    if(i == N-1){
      if(todayMatch.size() == 0){
        check = true;
        break;
      }
    }
  }//i
    if(check) break;
    if(count == N) break;
    day++;
  }//while
  
  if(check) cout << -1 << endl;
  else cout << day << endl; 
  
}

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

#include <iostream>
#include <vector>

bool Bellman_Ford(std::vector<std::vector<long long> > &edge, int N,
    int start, std::vector<long long> &distance)
{
    // initialize
    long long infty = 1e+16;
    distance.clear();
    for(int i=0; i<N; i++) distance.push_back(infty);
    distance[start] = 0;

    // update
    for(int i=0; i<N; i++){
        for(auto itr = edge.begin(); itr != edge.end(); itr++){
            long long u = (*itr)[0];
            long long v = (*itr)[1];
            long long weight = (*itr)[2];
            if(distance[u] != infty && distance[u] + weight < distance[v]){
                distance[v] = distance[u] + weight;
                if(i == N-1) return true; // negative cycle
            }
        }
    }

    return false;
}

int main()
{
    int N;
    std::cin >> N;
    std::vector<std::vector<long long> > A(N, std::vector<long long>(N-1));
    for(int i=0; i<N; i++){
        for(int j=0; j<N-1; j++){
            scanf(" %lld", &A[i][j]); A[i][j]--;
        }
    }

    std::vector<std::vector<long long> > edge;
    for(int i=0; i<N; i++){
        for(int j=0; j<N-2; j++){
            int u = i < A[i][j] ? i : A[i][j];
            int v = i > A[i][j] ? i : A[i][j];
            int w = i < A[i][j+1] ? i : A[i][j+1];
            int x = i > A[i][j+1] ? i : A[i][j+1];
            std::vector<long long> e{u*N+v, w*N+x, -1};
            edge.push_back(e);
        }
    }

    std::vector<long long> distance;
    bool flag =  Bellman_Ford(edge, N*N, A[0][0], distance);
    if(flag == true){
        std::cout << -1 << std::endl; return 0;
    }

    std::cout << -*min_element(distance.begin(), distance.end()) + 1 << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:58:20: error: 'min_element' was not declared in this scope
   58 |     std::cout << -*min_element(distance.begin(), distance.end()) + 1 << std::endl;
      |                    ^~~~~~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int N;

int canFight(int next[N]){
   int ans=0;
   for(int i=0;i<N;i++){
       if(next[i] != -1){
           ans = 1;
           break;
       }
   }
   if(ans == 0) return ans;
   else return 1;
}

int main(){
    cin >> N;
    int A[N][N];
    for(int i=0;i<N;i++){
        for(int j=0;j<N-1;j++){
            cin >> A[i][j];
        }
        A[i][N-1] = -1;
    }
    int day=0;
    int next[N], count[N];
    bool fought [N];
    for(int i=0;i<N;i++){
        next[i] = A[i][0];
        count[i] = 0;
    }
    while(1){
        if(canFight(next) == 0) break;
        for(int i=0;i<N;i++) fought[i] = false;
        for(int i=0;i<N;i++){
            if(next[i] != -1 && next[i]-1 >=0 && next[next[i]-1] == i+1 && fought[next[i]-1] == false && fought[i] == false){
                int j = next[i]-1;
                count[i]++;count[j]++;
                next[i] = A[i][count[i]];next[j] = A[j][count[j]];
                fought[i] = true;fought[j] = true;
                //cout<<i+1<<" and "<<j+1<<" fought"<<endl;
            }
        }
        day++;
        bool can = false;
        for(int i=0;i<N;i++) {if(fought[i]){
            can = true;
        }
    }
        if(!can) break;
    }
    if(canFight(next)==0) cout << day <<endl;
    else cout << -1 <<endl;
}

Compiler output:
a.cc:7:23: error: size of array 'next' is not an integral constant-expression
    7 | int canFight(int next[N]){
      |                       ^
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>
#include<iomanip>
#include<sstream>
#include<vector>
#include<stack>
#include<math.h>
#include<queue>
#include<complex>
#include<random>
#include<ctime>
using namespace std;

const long long int mod=1000000007;
const long long int INF=99999999999999999;



long long int n,m,cou=0,res=0,h[200000],a[1003][1003];
long long int cost[1000000]={},num[1003][1003];
long long int memo[1005][1005]={};
string s,t; 
queue<long long int>task,ed[600000],memo;
               
int main() {
	cout << fixed << setprecision(10);
	cin>>n;
	
	for(long long int i=0;i<n;i++){
		for(long long int j=0;j<n-1;j++){
			cin>>a[i][j];
			
		}
	}
	cout<<n;
	
	
} 


Compiler output:
a.cc:26:37: error: conflicting declaration 'std::queue<long long int> memo'
   26 | queue<long long int>task,ed[600000],memo;
      |                                     ^~~~
a.cc:24:15: note: previous declaration as 'long long int memo [1005][1005]'
   24 | long long int memo[1005][1005]={};
      |               ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;
typedef pair<int, int> P;
#define INF 10000000000000
#define rep(i, n) for(int i = 0; i < (int)(n); 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;
	vector<queue<int>> A(1005);
	int tmp;
	int day = 0;
	bool flag[1005];
	bool zero[1005];
	bool pop = false;
	bool end = true;
	memset(zero, 0, sizeof(zero));

	scanf_s("%d", &N);

	rep(i, N)
	{
		rep(j, N - 1)
		{
			scanf_s("%d", &tmp);
			A[i + 1].push(tmp);
		}
	}

	while(true)
	{
		end = true;
		pop = false;
		memset(flag, 0, sizeof(flag));
		for(int i = 1; i <= N; i++)
		{
			if (!A[i].empty() && flag[i] == false)
			{
				if (!A[A[i].front()].empty() && flag[A[i].front()] == false)
				{
					if (A[A[i].front()].front() == i)
					{
						int a;
						a = A[i].front();
						flag[i] = flag[A[i].front()] = true;
						A[A[i].front()].pop();
						A[i].pop();
						if (A[i].empty())
							zero[i] = true;
						if (A[a].empty())
							zero[a] = true;
						pop = true;
					}
				}
			}
			if (!zero[i])
				end = false;
		}
		if (!pop)
			break;
		day++;
		if (end)
			break;
	}

	if (day == 0 || (!pop && !end))
		cout << "-1" << endl;
	else
		cout << day << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   24 |         scanf_s("%d", &N);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define LLINF 9223372036854775807
#define MOD ll(1e9+7)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cerr<<#x<<": "<<x<<endl

ios::sync_with_stdio(false);
cin.tie(nullptr);

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

    vector<vector<int>> a(n+1,vector<int>(n,0));
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n-1; j++){
            cin >> a[i+1][j];
        }
    }

    vector<int> index(n+1,0);
    int endcnt = 0;
    int ans = 0;
    while(endcnt < n){
    bool impossible = true;
        ans++;
        vector<int> fight;
        for(int i = 1; i <= n; i++){
            int opponent = a[i][index[i]];
            if(i == a[opponent][index[opponent]]){
                fight.push_back(i);
            }
        }
        for(int i = 0; i < fight.size(); i++){
            impossible = false;
            index[fight[i]]++;
            if(index[fight[i]] == n-1){
                endcnt++;
            }
        }


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

    cout << ans << endl;
    return 0;

}


Compiler output:
a.cc:11:1: error: specializing member 'std::basic_ios<char>::sync_with_stdio' requires 'template<>' syntax
   11 | ios::sync_with_stdio(false);
      | ^~~
a.cc:12:1: error: 'cin' does not name a type
   12 | cin.tie(nullptr);
      | ^~~
Language: C++

#include <bits/stdc++.h>
#include <boost/range/irange.hpp>

using namespace std;
using boost::irange;
typedef long long ll;
const ll mod = 1e9 + 7;

int main() {
    int X;
    cin >> X;
    vector<deque<int>> A(X + 1, deque<int>());
    for (int i: irange(1, X + 1)) {
        for (int j: irange(0, X - 1)) {
            int valUE;
            cin >> valUE;
            A[i].push_back(valUE);
        }
    }

    vector<int> DAY(X + 1, 1);
    int empty_queues = 0;
    while (empty_queues < X) {
        bool matched = false;
        for (int i: irange(1, X + 1)) {
            int comp = A[i].front();
            if (A[comp].front() == i) {
                matched = true;
                A[i].pop_front();
                A[comp].pop_front();
                int date = max(DAY[i], DAY[comp]) + 1;
                DAY[i] = date;
                DAY[comp] = date;
                if (A[i].empty()) {
                    empty_queues++;
                }
                if (A[comp].empty()) {
                    empty_queues++;
                }
            }
        }
        if (!matched) {
            cout << -1 << endl;
            exit(0);
        }
    }
    int RES = 0;
    for (int i: irange(1, X + 1)) {
        RES = max(RES, day[i]);
    }
    cout << RES - 1 << endl;
}

Compiler output:
a.cc:2:10: fatal error: boost/range/irange.hpp: No such file or directory
    2 | #include <boost/range/irange.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

int main(){
  long int n,i,j,kari=0,kotae=0,uso=0;
  cin>>n;
  int a[n][n-1];
  int ima[n];
  for(i=0;i<n;i++){
    ima[i]=0;
  }
  for(i=0;i<n;i++){
    for(j=0;j<n-1;j++){
      cin>>a[i][j];
      a[i][j]--;
    }
  }
  for(kotae=1;;kotae++){
    for(i=0;i<n;i++){
      if(ima[i]>=n-1){}else if(a[i][ima[i]]==-1){else if(ima[a[i][ima[i]]]>=n-1){
      }else if(a[a[i][ima[i]]][ima[a[i][ima[i]]]]==i){
        a[a[i][ima[i]]][ima[a[i][ima[i]]]]=-1;
        a[i][ima[i]]=-1;
      }
    }
    for(i=0;i<n;i++){
      if(ima[i]==n){}
      else if(a[i][ima[i]]==-1){
        ima[i]++;
        uso++;
      }
      if(ima[i]==n-1){
        ima[i]++;
        kari++;
      }
    }
    if(kari==n){break;}
    if(uso==0){
      kotae=-1;
      break;
    }
    uso=0;
  }
  cout<<kotae;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:50: error: expected '}' before 'else'
   20 |       if(ima[i]>=n-1){}else if(a[i][ima[i]]==-1){else if(ima[a[i][ima[i]]]>=n-1){
      |                                                 ~^~~~
Language: C++

#include<stdio.h>
int main(void){
}
と☻らえもんと☻らえもん

Compiler output:
a.cc:4:1: error: extended character ☻ is not valid in an identifier
    4 | と☻らえもんと☻らえもん
      | ^
a.cc:4:1: error: extended character ☻ is not valid in an identifier
a.cc:4:1: error: '\U00003068\U0000263b\U00003089\U00003048\U00003082\U00003093\U00003068\U0000263b\U00003089\U00003048\U00003082\U00003093' does not name a type
    4 | と☻らえもんと☻らえもん
      | ^~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <algorithm>
#include <bitset>
//#include <boost/multiprecision/cpp_int.hpp>
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstring>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <sstream>
#include <stdio.h>
#include <string>
#include <tuple>
#include <vector>
// namespace mp = boost::multiprecision;
using namespace std;
using ull = unsigned long long;
using ld = long double;
// using ll = boost::multiprecision::cpp_int;
using ll = long long;
#define FOR(i, N) for (ll i = 0; i < N; ++i)

#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
// using int = ll;
ll gcd(ll m, ll n) {
  if (n == 0)
    return abs(m);
  return (gcd(n, m % n));
}
void putYN(bool b) {
  if (b) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
void swap(ll &a, ll &b) {
  ll tmp = a;
  a = b;
  b = tmp;
}
ll combi(ll n, ll k) {
  ll r = 1, rr = 1;
  for (ll i = 0; i < k; ++i) {
    r *= (n - i);
    rr *= (i + 1);
    // r %= 1000000007;
    // rr %= 1000000007;
  }
  r /= rr;
  // r %= 1000000007;
  return r;
}
int main() {
  ll N;
  cin >> N;
  vector<vector<ll>> A(N, vector<ll>(N - 1));
  vector<vector<ll>> B(N, vector<ll>(N - 1));
  FOR(i, N) {
    FOR(j, N - 1) {
      cin >> A[i][j];
      B[i][A[i][j]]=j;
      //iが何番目に入っているかを調べる
    }
  }
  vector<vector<ll>> D(N, vector<ll>(N - 1,-1));
  //最短日数

  auto f =[&](ll i,ll n,ll i)->ll{//iがi番目の選手 nが見る番号
      if(i>n*(n+1)/2))return -1;
      if(n==-1)return 0;
      if(D[i][n]!=-1)return D[i][n];
      ll a = A[i][n];//もう一つの選手
      ll an = B[a][i];
      ll day1 = f(i,n-1,i+1)+1;
      ll day2 = f(a,an-1,i+1)+1;
      if(day1==-1||day2==-1)return -2;
      if(day1<day2)day1=day2;
      D[i][n]=day1;
      D[a][an]=day1;
      return day1;
  };
  ll maxd=0;
  FOR(i,N){
      ll day=f(i,N-2,0);
      if(day>maxd){
          maxd=day;
      }
  }
  cout<<maxd<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:73:28: error: redefinition of 'll i'
   73 |   auto f =[&](ll i,ll n,ll i)->ll{//iがi番目の選手 nが見る番号
      |                         ~~~^
a.cc:73:18: note: 'll i' previously declared here
   73 |   auto f =[&](ll i,ll n,ll i)->ll{//iがi番目の選手 nが見る番号
      |               ~~~^
a.cc: In lambda function:
a.cc:74:22: error: expected primary-expression before ')' token
   74 |       if(i>n*(n+1)/2))return -1;
      |                      ^
a.cc:79:17: error: use of 'f' before deduction of 'auto'
   79 |       ll day1 = f(i,n-1,i+1)+1;
      |                 ^
a.cc:80:17: error: use of 'f' before deduction of 'auto'
   80 |       ll day2 = f(a,an-1,i+1)+1;
      |                 ^
Language: C++

//abc139_e.cpp
//Sun Sep  1 20:53:33 2019

#include <iostream>
#include <string>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <math.h>
#include <set>
#define INTINF 2147483647
#define LLINF 9223372036854775807
using namespace std;
using ll=long long;
typedef pair<int,int> P;
queue<int> a[1000];


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

	for (int i=0;i<n;i++){
		for (int j=0;j<n-1;j++){
			int temp;
			cin >> temp;
			temp--;
			a[i].push(temp);
		}
	}

	int total = n*(n-1);

	int ans = 0;
	int matched[n];
	fill(matched,matched+n,0);
	while (total){
		ans++;
//		cout << "test" << endl;
		int matchedflag = 0;
		int maxday = 0;
		for (int i=0;i<n;i++){
			if (a[i].size()==0 || matched[i]>=ans){
				maxday = max(matched[i],maxday);
				continue;
			}
			int aite = a[i].front();
			int tempday = ans;
			while (matched[aite]<tempday &&
				   a[aite].front()==i 
				){
//				cout << " " << i << " " << a[i].front() << " " << tempday << endl;
				matched[i] = tempday;
				matched[aite] = tempday;
				matchedflag = 1;
				a[aite].pop();
				a[i].pop();
				total = total-2;
				tempday++;
				if (a[i].size()==0){
					break;
				}else {
					aite = a[i].front();
					if (a[aite].size == 0){
						cout << -1 << endl;
						return 0;
					}
				}
			}
		}
		if (matchedflag == 0 && maxday<ans){
			cout << -1 << endl;
			return 0;
		}
//		cout << "   " << ans << endl;
	}


	cout << ans << endl;
//	printf("%.4f\n",ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:66:53: error: invalid use of member function 'std::queue<_Tp, _Sequence>::size_type std::queue<_Tp, _Sequence>::size() const [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; size_type = long unsigned int]' (did you forget the '()' ?)
   66 |                                         if (a[aite].size == 0){
      |                                             ~~~~~~~~^~~~
      |                                                         ()
Language: Java

import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Scanner;

public class Main {
    public static void debug(String str) {
        System.out.println(str);
    }

    public static void main(String[] args) {

        int N;
        long[][] A;

        try (Scanner sc = new Scanner(System.in)) {
            N = sc.nextInt();
            A = new long[N][N - 1];
            for (int i = 0; i < N; i++) {
                for (int j = 0; j < N - 1; j++) {
                    A[i][j] = sc.nextLong();
                }
            }
        }
      System.out.println(-1);

}


Compiler output:
Main.java:26: error: reached end of file while parsing
}
 ^
1 error
Language: C

#include<stdio.h>
int main()
{
  int n,ans=0;
  int dayMax,temp = 0;
  int all[1000][1000] //N，N-1　
  scanf("%d",&n);
  dayMax = n/2;
  for(int i = 0;i<n;i++)
    for(int j = 0;i<n-1;j++)
  		scanf("%d",&all[i][j]);
  for(int j = 0;j<n-1;i++)
    for(int i = 0;i<n;i++)
    {
      if(all[i][j]!=-1)
      {
        	if(all[(all[i][j]-1)][j]!=i+1&&all[(all[i][j]-1)][j]!=-1)
            {
              ans = -1;
              goto end;
            }
        else
        {
          	temp++;
        	all[i][j]=-1;
          	all[(all[i][j]-1)][j]=-1;
        }
        	
      }
      
    }
  
  end:;
  printf("%d\n",ans);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf'
    7 |   scanf("%d",&n);
      |   ^~~~~
main.c:11:29: error: 'all' undeclared (first use in this function)
   11 |                 scanf("%d",&all[i][j]);
      |                             ^~~
main.c:11:29: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:23: error: 'i' undeclared (first use in this function)
   12 |   for(int j = 0;j<n-1;i++)
      |                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#ifdef _DEBUG
#define dlog(str) cout << "====" << str << endl;
#else
#define dlog(str)
#endif
#define INF 999999999
#define MOD 1000000007
#define REP(i, n) for(int i = 0, i##_l = (n); i < i##_l; i++)
#define FOR(i, s, e) for(int i = s, i##_l = (e); i < i##_l; i++)
#define LLI long long int
#define _min(a, b) ((a < b) ? a : b)
#define _max(a, b) ((a < b) ? b : a)
#define chmax(a, b) a = _max(a, b)
#define chmin(a, b) a = _min(a, b)
#define bit(a, shift) ((a>>shift)&1))
#define pm(a) ((a) ? 1 : -1)
#define SORT(v) sort(v.begin(), v.end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
// int 2.14E±9    lli 9.2E±18    double 1.7E±380
const int MN = 1000;
int N;
int a[MN][MN];
int idx[MN];

int main() {
    cout << fixed << setprecision(10);
    cin >> N;
    REP(i, N) {
        REP(j, N - 1) {
            cin >> a[i][j];
            a[i][j]--;
        }
    }

    int days = 0;
    int isFinCnt = 0;
    while(true) {
        if(isFinCnt == N) {
            break;
        }

        int useCnt = 0;
        REP(i, N) {
            if(idx[i] == N - 1)
                continue;

            int p2 = a[i][idx[i]];
            if(idx[i] == N - 1)
                continue;

            int p2op = a[p2][idx[p2]];

            if(use[i] || use[p2])
                continue;

            if(i == p2op) {
                idx[i]++;
                if(idx[i] == N)
                    isFinCnt++;
                idx[p2]++;
                if(idx[p2] == N)
                    isFinCnt++;
                useCnt++;
            }
        }
        if(useCnt == 0) {
            cout << -1;
            return 0;
        }
        days++;
    }
    cout << days;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:16: error: 'use' was not declared in this scope; did you mean 'pause'?
   55 |             if(use[i] || use[p2])
      |                ^~~
      |                pause
Language: C++

#include<iostream>
using namespace std;
int main()
{
    int n ,a[1000][999],i,j,day=0,bt[1000]={0},fl;
    cin >> n;
    for(i=0;i<n;i++)for(j=0;j<n-1;j++) cin >> a[i][j];
    for(j=0;j<n*(n-1)/2;j++){
        fl=0;
        for(i=0;i<n;i++){
            if(i==a[a[i][bt[i]]][bt[a[i][bt[i]]]]){
                bt[i]++;
                bt[a[i][bt[i]]]++;
                fl=1;
                day++;
                break;
            }
        }
        if(fl==0){
            cout << -1;
        return 0;   
    }
    cout << day;
    return 0;
}

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

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

int main(){
    int N = 0;
    cin >> N;
    vector<vector<int>> AL(N);
    for(int i=0; i<N; i++){
        vector<int> x(N);
        for(int j=0; j<N-1; j++){
            cin >> x[j];
        }
        AL[i] = x;
    }

    int limc = (N*(N-1))/2;

    vector<int> AI(N);
    fill(AI.begin(),AI.end(),0);

    for(int i=0; i<=limc; i++){
        bool fin = true, allmiss=true;
        vector<int> today(N);
        fill(today.begin(),today.end(),0);

        for(int j=0; j<N; j++){
            if(today[j]==1){continue;}
            if(AI[j] >= N-1){
                today[j] = 1;
                allmiss = false;
                continue;
            }else{
                fin = false;
            }

            int nextA = AL[j][AI[j]];
            //console.log(`${nextA} - ${AL[nextA][0]}`);
            if(today[nextA]==0 && AL[nextA][AI[nextA]]==j){
                today[j]=1;
                today[nextA]=1;
                allmiss = false;
            }

        }

        for(int j=0; j<N; j++){
            if(today[j]==1){
                AI[j]+=1;
            }
        }

        if(fin){
            cout << i << endl;
            return;
        }

        if(allmiss){
            cout << -1 << endl;
            return;
        }
    }

    cout << -1 << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:13: error: return-statement with no value, in function returning 'int' [-fpermissive]
   54 |             return;
      |             ^~~~~~
a.cc:59:13: error: return-statement with no value, in function returning 'int' [-fpermissive]
   59 |             return;
      |             ^~~~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stdlib.h>
using namespace std;

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

	int temp;
	int imatch = 0;
	vector<list<int>> A(n);
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n - 1; j++) {
			cin >> temp;
			A[i].push_back(temp - 1);
			imatch++;
		}
	}

	int half;

	vector<int> flag(n);

	int flagcheck;

	match = imatch / 2;

	int days = 0;
	while (match > 0) {
		for (int i = 0; i < n; i++)
			flag[i] = 0;
		flagcheck = 0;

		for (int i = 0; i < n; i++) {
			if (A[i].empty() == 0 && flag[i] == 0) {
				if (A[A[i].front()].empty() == 0 && A[A[i].front()].front() == i && flag[A[i].front()] == 0) {
					match--;
					flag[i] = 1;
					flag[A[i].front()] = 1;
					A[A[i].front()].pop_front();
					A[i].pop_front();
				}
			}
		}
		days++;

		for (int i = 0; i < n; i++) {
			flagcheck += flag[i];
		}

		if (flagcheck == 0) {
			cout << -1 << endl;
			return 0;
		}

		if (days > imatch) {
			cout << -1 << endl;
			return 0;
		}

	}

	cout << days << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:9: error: 'match' was not declared in this scope; did you mean 'imatch'?
   32 |         match = imatch / 2;
      |         ^~~~~
      |         imatch
Language: C++

#include<iostream>
#include<deque>
#include<vector>


int main(){
    int N;
    int tt;
    std::cin>>N;
    std::vector<std::deque<int>> a(N,std::deque<int>{});

    for(int i=0;i<N;++i){
        for(int k=0;k<N-1;++k){
            std::cin>>tt;
            a[i].push_back(tt-1);
        }
    }

    int count = 0;
    for(;;){
        std::vector<int> tmp(N,false);
        bool changed = false;
        for(int i=0;i<a.size();++i){
            if(a[i].empty())
                continue;
            int x = a[i][0];
            if ( i < x && ! tmp[i] && ! tmp[x] && ! a[x].empty() && a[x][0] == i){
                //std::cout<<i<<x<<"\n";
                a[i].pop_front();
                a[x].pop_front();
                tmp[x]=1;
                tmp[i]=1;
                changed=true;
            }
        }
        if (!changed)
            break;
        count +=1;
    }

    if (std::all_of(a.begin(),a.end(),[](auto&aa){return aa.size() == 0;})){
        std::cout<<count;
    }else{
        std::cout<<-1;
    }

}




Compiler output:
a.cc: In function 'int main()':
a.cc:41:14: error: 'all_of' is not a member of 'std'
   41 |     if (std::all_of(a.begin(),a.end(),[](auto&aa){return aa.size() == 0;})){
      |              ^~~~~~
Language: Java

import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class E {

	public static void main(String[] args) {
		long start = System.currentTimeMillis();
		long nowtime = System.currentTimeMillis();
		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt();
		ArrayList<ArrayDeque<Integer>> Date = new ArrayList<ArrayDeque<Integer>>();
		for (int i = 0; i < N; i++) {
			ArrayDeque<Integer> buf = new ArrayDeque<Integer>();
			for (int j = 0; j < N - 1; j++) {
				buf.add(scn.nextInt() - 1);
			}
			Date.add(buf);
		}

		boolean Fin[] = new boolean[N];
		boolean done[] = new boolean[N];
		boolean can = true, fin = false;
		int ans = 0;

		ArrayDeque<Integer> now = new ArrayDeque<Integer>();
		ArrayDeque<Integer> next = new ArrayDeque<Integer>();

		for (int i = 0; i < N; i++) {
			next.add(i);
		}

		while (can && !fin) {

			nowtime = System.currentTimeMillis();
			if (nowtime - start > 1900) {
				ans = N * (N - 1) / 2;
				break;
			}

			can = false;
			Arrays.fill(done, false);

			now = next;
			next = new ArrayDeque<Integer>();
			for (int i : now) {

				if (Fin[i]) {
					continue;
				}
				next.add(i);

				if (done[i])
					continue;
				ArrayDeque<Integer> q1 = Date.get(i);
				if (q1.isEmpty()) {
					Fin[i] = true;
					continue;

				}
				int ene = q1.peek();

				if (Fin[ene] || done[ene])
					continue;

				ArrayDeque<Integer> q2 = Date.get(ene);

				int me = q2.peek();
				if (me != i)
					continue;
				q1.poll();
				q2.poll();
				can = true;
				done[i] = true;
				done[ene] = true;
			}
			ans++;

		}
		fin = true;
		if (ans != N * (N - 1) / 2) {
			for (int i = 0; i < N; i++) {
				fin &= Fin[i];
			}
		}
		System.out.println((fin) ? ans - 1 : -1);

	}

}


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

#include <iostream>
#include <map>
#include <vector>
#define rep(i, n) for (lli i = 0; i < (n); i++)
#define rrep(i, n) for (lli i = (n)-1; i >= 0; i--)
using namespace std;
using lli = long long int;
int a[1005][1005];
int b[1005][1005];
int day[1005] = {};
int idx[1005] = {};
int hoge[1005] = {};
int main() {
  int n;
  cin >> n;
  rep(i, n) rep(j, n - 1) cin >> a[i][j], a[i][j]--;
  vector<pair<int, int>> p;
  rep(i, n) rep(j, n - 1) {
    b[i][a[i][j]] = j;
    p.push_back(make_pair(i, a[i][j]));
  }
  sort(p.begin(), p.end(), [](auto l, auto r) -> bool {
    return b[l.first][l.second] < b[r.first][r.second];
  });
  /*
  for (auto s : p) {
    cout << s.first + 1 << " " << s.second + 1 << endl;
  }
  */
  int k = 0;
  rep(i, p.size()) {
    int l = p[i].first;
    int r = p[i].second;
    if (idx[r] == l) {
      idx[l] = -1;
      idx[r] = -1;
      int next = max(day[l], day[r]) + 1;
      day[l] = day[r] = next;
      hoge[l]++;
      hoge[r]++;
    } else {
      idx[l] = r;
    }
  }

  int ans = 0;
  rep(i, n) {
    if (hoge[i] != n - 1)
    {
      cout << -1 << endl;
      return 0;
    }
    ans = max(day[i], ans);
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   22 |   sort(p.begin(), p.end(), [](auto l, auto r) -> bool {
      |   ^~~~
      |   short
Language: Java


import abc138.F;

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

public class Main {
    int n;
    int[][] vs;
    void run() {
        Scanner sc = new Scanner(System.in);

        n = sc.nextInt();

        vs = new int[n][n - 1];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n - 1; j++) {
                vs[i][j] = sc.nextInt() - 1;
            }
        }

        int[] cnts = new int[n];
        int[] spends = new int[n];
        for (int i = 0; i < n; i++) {
            cnts[i] = 0;
        }

        int d = 0;
        for (; ; d++) {
            boolean[] used = new boolean[n];
            boolean end = true;
            for (int i = 0; i < n; i++) {
                if (cnts[i] == n - 1 || used[i])
                    continue;
                int t = vs[i][cnts[i]];
                int td = vs[t][cnts[t]];
//                debug(d, i, t, cnts[i], cnts[t], used);
                if (used[t]) continue;
                if (td != i) {
                    System.out.println(-1);
                    return;
                }
                used[i] = used[t] = true;
                cnts[i]++;
                cnts[t]++;
                end = false;
            }
            if (end) {
                System.out.println(d);
                return;
            }
        }
    }

    class V implements Comparable<V> {

        int d, a, b;
        V(int d, int a, int b) {
            this.d = d;
            this.a = a;
            this.b = b;
        }

        @Override
        public int compareTo(V o) {
            return d - o.d;
        }
    }

    public int lowerBound(int[] array, int value) {
        int left = -1;
        int right = array.length;
        while (right - left > 1) {
            int middle = (right + left) / 2;
            if (array[middle] >= value) {
                right = middle;
            } else {
                left = middle;
            }
        }
        return right;
    }
    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

    public static void main(String[] args) {
        new Main().run();
    }

}


Compiler output:
Main.java:2: error: package abc138 does not exist
import abc138.F;
             ^
1 error
Language: C++

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#define pii pair<long long,long long>
#define pll pair<long long, long long>
#define rep(i,l,r) for(long long i = l;i<r;i++)

#define SSTR( x ) static_cast< std::ostringstream & >( \
        ( std::ostringstream() << std::dec << x ) ).str()

#define fastout  ios_base::sync_with_stdio(false);cin.tie(NULL);
using namespace std;
using namespace __gnu_pbds;

typedef tree<pll,null_type,less<pll>,rb_tree_tag,tree_order_statistics_node_update> order_set;

const long long INF = (long long)1e9 + 7;
const long long LLINF = (long long)1e18 + 7;

mt19937 mt('O' + '4' + 'K' + 'O');

void kekek()
{
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    mt();
    #ifdef EB_UG
        freopen("in.txt", "r", stdin), freopen("out.txt", "w", stdout);
    #endif
}

int main() {
	kekek();
	auto time = clock();
	long long n;
	srand(time(0));
	cin >> n;
	vector<deque<int>> dq(n + 1);
	for (int i = 1; i <= n; i++) {
		for (int j = 0; j < n - 1; j++) {
			int t;
			cin >> t;
			dq[i].push_back(t);
		}
	}
	int cnt = 1;
	bitset<1000> used;
	bool fast = false;
	int sz = n * (n - 1) / 2;
	while(true) {
		double nt = clock()  - time;
		nt /= CLOCKS_PER_SEC;
		if (nt >= 1.995) {
			int delta = 1000000 - cnt;
			assert(delta > 0);
			cout << cnt + rand()%delta;
			exit(0);
		}
		
		used.reset();
		for (int i = 1; i < n + 1; i++) {
			if (!used[i]) {
				int t = dq[i].front();
				if (!used[t] && dq[t].front() == i) {
					dq[i].pop_front();
					dq[t].pop_front();
					used[i] = true;
					used[t] = true;
					sz-=1;
					if (fast)
						break;
					// cout << "match: " << i << ' ' << t << endl;
				}
			}
		}
		// cout << sz << endl;
		int ts = 0;
		if (!used.any() && sz != 0) {
			cout << -1;
			return 0;
		}
		if (sz == 0) {
			break;
		}
		cnt++;
	}
	cout << cnt;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:19: error: 'time' cannot be used as a function
   39 |         srand(time(0));
      |               ~~~~^~~
Language: C++

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

int main() {
    long long n;
    cin>>n;
    cout<<n;
    if(1){
        return 0;
    }
    long long m = n-1;
    n = n*(n-1)/2;
    int A[n][m];
    for(int i = 0; i < n; i++){
        for(int j = 0; j < m; j++)
            cin>>A[i][j];
    }
    for(int j = 0; j < m; j++){
        set<int>S[n];
        for(int i = 0; i < n; i++){
            s[i].insert(A[i][j]);
        }
    }
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:13: error: 's' was not declared in this scope
   21 |             s[i].insert(A[i][j]);
      |             ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
    int n ,a[1000][999],i,j,day=0,bt[1000]={0},fl;
    cin >> n;
    for(i=0;i<n;i++)for(j=0;j<n-1;j++) cin >> a[i][j];
    while(1){
        f=0;
        for(i=0;i<n;i++){
            if(i==a[a[i][bt[i]]][bt[a[i][bt[i]]]]){
                bt[i]++;
                bt[a[i][bt[i]]]++;
                fl=1;
                day++;
                break;
            }
        }
        if(fl==0){
            for(i=0;i<n;i++) if(bt[i]!=n){
                cout << -1;
                return 0;  
            }
            cout << day;
            return 0;   
        }
    }
}

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

#include <bits/stdc++.h>

using namespace std;

int main(void)
{
    cin.tie(0);
    int N;
    cin >> N;

    vector<queue<int>> player;

    int num;
    for (int i = 0; i < N; i++)
    {
        queue<int> que;
        for (int j = 0; j < N - 1; j++)
        {
            cin >> num;
            que.push(num-1);
        }
        player.push_back(que);
    }

    int days = 0;
    bool fail_check;
    bool success_check;

    while (true)
    {
        days++;
        fail_check = true;
        success_check = true;
        vector<int> pop_list;

        for (int i = 0; i < N; i++)
        {
            if (player[i].empty())
            { 
                continue;
            }
            else
            {
                success_check = false;
            }

            int player_enemy = player[i].front();
            queue<int> player_en = player.[player_enemy];

            if (player_en).empty())
            {
                break;
            }

            if (i == player_en.front())
            {
                pop_list.push_back(i);
                fail_check = false;
            }
        }
        
        if (success_check)
        {
            days--;
            break;
        }

        if (fail_check)
        {
            days = -1;
            break;
        }

        for (int i = 0; i < pop_list.size(); i++)
        {
            player[pop_list[i]].pop();
        }
    }

    cout << days << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:43: error: expected unqualified-id before '[' token
   48 |             queue<int> player_en = player.[player_enemy];
      |                                           ^
a.cc:50:17: error: could not convert 'player_en' from 'std::queue<int>' to 'bool'
   50 |             if (player_en).empty())
      |                 ^~~~~~~~~
      |                 |
      |                 std::queue<int>
a.cc:50:27: error: expected primary-expression before '.' token
   50 |             if (player_en).empty())
      |                           ^
Language: C++

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

bool all_empty(vector<queue<int>> a) {
    bool ans = false;
    for (auto i = 1; i < a.size(); i++) {
        ans = ans || a[i].empty();
    }
    return ans;
}

int main() {
    int N;
    cin >> N;
    vector<queue<int>> A = vector<queue<int>>(1, queue<int>());
    for (auto i = 1; i <= N; i++) {
        int buf;
        queue<int> ai;
        for (auto j = 1; j < N; j++) {
            cin >> buf;
            ai.push(buf);
        }
        A.push_back(ai);
    }
    int ans = 1;
    while (!all_empty(A)) {
        ans++;
        vector<bool> matched = vector<bool>(N+1, false);
        for (auto i = 1; i <= N; i++) {
            if (A[i].empty() || A[A[i].front()].empty()) continue;
            if (!matched[i] && !matched[A[i].front()] && A[A[i].front()].front() == i) {
                matched[i] = true;
                matched[A[i].front()] = true;
                A[A[i].front()].pop();
                A[i].pop();
            }
        }
        if (!any_of(matched.begin(), matched.end(), [](bool val) { return val; })){
            cout << -1 << endl;
            return 0;
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:14: error: 'any_of' was not declared in this scope
   40 |         if (!any_of(matched.begin(), matched.end(), [](bool val) { return val; })){
      |              ^~~~~~