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

v#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
signed main(){
  int N;
  cin>>N;
  vector<pair<bitset<15>,bitset<15>>> A(N);
  rep(i,0,N){
    int Z;
    cin>>Z;
    rep(j,0,Z){
    int X;
    bool Y;
    cin>>X>>Y;
      if(Y) A.at(i).first.set(X-1);
      else A.at(i).second.set(X-1);
    }
  }
  int ans=0;
  rep(i,0,(1<<N)){
    bitset<15> B(i);
    bool flag=1;
    rep(j,0,N){
      if(!B.test(j)){
        rep(k,0,N){
          if(A.at(j).first.test(k)){
            if(B.test(k)){
              flag=0;
              //cout<<i<<" "<<j<<" "<<k<<" "<<B<<endl;
              goto XYZ;
            }
          }
          if(A.at(j).second.test(k)){
            if(!B.test(k)){
              flag=0;
              //cout<<i<<" "<<j<<" "<<k<<" "<<B<<endl;
              goto XYZ;
            }
          }
        }
      }
    }
    XYZ:
    if(flag){
      ans=N-B.count();
      break;
    }
  }
  cout<<ans<<endl;
  }

Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | v#include<bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'v' does not name a type
    1 | v#include<bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:10:3: error: 'cin' was not declared in this scope
   10 |   cin>>N;
      |   ^~~
a.cc:11:3: error: 'vector' was not declared in this scope
   11 |   vector<pair<bitset<15>,bitset<15>>> A(N);
      |   ^~~~~~
a.cc:11:10: error: 'pair' was not declared in this scope
   11 |   vector<pair<bitset<15>,bitset<15>>> A(N);
      |          ^~~~
a.cc:11:15: error: 'bitset' was not declared in this scope
   11 |   vector<pair<bitset<15>,bitset<15>>> A(N);
      |               ^~~~~~
a.cc:11:25: error: expected primary-expression before ',' token
   11 |   vector<pair<bitset<15>,bitset<15>>> A(N);
      |                         ^
a.cc:11:37: error: expected primary-expression before '>' token
   11 |   vector<pair<bitset<15>,bitset<15>>> A(N);
      |                                     ^
a.cc:11:39: error: 'A' was not declared in this scope
   11 |   vector<pair<bitset<15>,bitset<15>>> A(N);
      |                                       ^
a.cc:25:16: error: 'B' was not declared in this scope
   25 |     bitset<15> B(i);
      |                ^
a.cc:53:3: error: 'cout' was not declared in this scope
   53 |   cout<<ans<<endl;
      |   ^~~~
a.cc:53:14: error: 'endl' was not declared in this scope
   53 |   cout<<ans<<endl;
      |              ^~~~
Language: C++

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

int ss(vector<int> seen,int n,vector<vector<vector<int>>> ta){
  int h=0;
  int u=0
  for(int i=0;i<n;i++){
    int cu=1;
    if(seen[i]){
      for(int j=0;j<ta[i].size();j++){
        if(ta[i][j].size()==0) continue;
        if(ta[i][j][1]!=seen[ta[i][j][0]]) {
          break;
          cu=0;
        }   
      }
    }
    if(cu) {
      for(int j=0;i<n;j++){
        u+=seen[j];
      }
      h=max(h,u);
    }
  }
  return h;
}
void hh(int n,vector<int> &seen,vector<vector<vector<int>>> ta,int &ans,int i){
  if(i==n){
    int h=ss(seen,n,ta);
    ans=max(ans,h);
    return ;
  }
  seen[i]=0;
  hh(n,seen,ta,ans,i+1);
  seen[i]=1;
  hh(n,seen,ta,ans,i+1);
}

  
  
          
int main() {
  int n}
  int ans=0;
  cin>>n;
  vector<int> seen(n,-1);
  vector<vector<vector<int>>> ta(n,vector<vector<int>> (n-1,vector<int> (0)));
for(int i=0;i<n;i++){
  int a;
  cin>>a;
  for(int j=0;j<a;j++){
    int q,w;
    cin>>q>>w;
    ta[i][q-1].push_back(w);
  }
}

  hh(n,seen,ta,ans,0);
  cout<<ans<<endl;
}
  

Compiler output:
a.cc: In function 'int ss(std::vector<int>, int, std::vector<std::vector<std::vector<int> > >)':
a.cc:7:3: error: expected ',' or ';' before 'for'
    7 |   for(int i=0;i<n;i++){
      |   ^~~
a.cc:7:15: error: 'i' was not declared in this scope
    7 |   for(int i=0;i<n;i++){
      |               ^
a.cc: In function 'int main()':
a.cc:43:8: error: expected initializer before '}' token
   43 |   int n}
      |        ^
a.cc: At global scope:
a.cc:45:3: error: 'cin' does not name a type
   45 |   cin>>n;
      |   ^~~
a.cc:46:20: error: 'n' was not declared in this scope; did you mean 'yn'?
   46 |   vector<int> seen(n,-1);
      |                    ^
      |                    yn
a.cc:47:34: error: 'n' was not declared in this scope; did you mean 'yn'?
   47 |   vector<vector<vector<int>>> ta(n,vector<vector<int>> (n-1,vector<int> (0)));
      |                                  ^
      |                                  yn
a.cc:47:57: error: 'n' was not declared in this scope; did you mean 'yn'?
   47 |   vector<vector<vector<int>>> ta(n,vector<vector<int>> (n-1,vector<int> (0)));
      |                                                         ^
      |                                                         yn
a.cc:48:1: error: expected unqualified-id before 'for'
   48 | for(int i=0;i<n;i++){
      | ^~~
a.cc:48:13: error: 'i' does not name a type
   48 | for(int i=0;i<n;i++){
      |             ^
a.cc:48:17: error: 'i' does not name a type
   48 | for(int i=0;i<n;i++){
      |                 ^
a.cc:58:5: error: expected constructor, destructor, or type conversion before '(' token
   58 |   hh(n,seen,ta,ans,0);
      |     ^
a.cc:59:3: error: 'cout' does not name a type
   59 |   cout<<ans<<endl;
      |   ^~~~
a.cc:60:1: error: expected declaration before '}' token
   60 | }
      | ^
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define repr(i,n) for(ll i=(n-1);i>=0;i--)
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
using namespace std;
ll INF = 1000000007;
using Graph = vector<vector<ll>>;

// 0 false, 1 true 
// stringの数字をint型にしてアスキーコードになったら -48する

vector<vector<pair<int,int>>> vec;
int ans = 0;

vector<int> vec_ans;

void bit_full_search(int n)
{
    //2^n回ループ
    for (int bit = 0; bit < (1<<n); ++bit) {
        vec_ans.resize(n,-1);
        queue<int> que;
        vector<int> true_man;
        ll count = 0;
        //cout << "{";
        for (int i = 0; i < n; ++i) {
            if (bit & (1<<i)) {
                //cout << " " << i << " ";
                true_man.pb(i);
                vec_ans[i] = 1;
                que.push(i);
                count++;
            }
        }
        //cout << "}" << endl;

        ll flag = 0;

        while(!que.empty()){
            int tmp = que.front();
            que.pop();

            for(int j = 0; j < vec[tmp].size(); j++){
                ll man = vec[tmp].at(j).first;
                ll say = vec[tmp].at(j).second;
                //cout << e << " " << man << " " << say << endl;
                if(vec_ans[man] != -1 && vec_ans[man] != say){
                    //cout << "dame" << endl;
                    flag = 1;
                    break;
                }else{
                    if(vec_ans[man] == -1 && say == 1){
                        que.push(man);
                    }
                    vec_ans[man] = say;
                }
            }
            if(flag == 1){
                break;
            }
        }

        if(flag == 0){
            if(int k = 0; k < vec_ans.size(); k++){
                if(vec_ans[k] == -1){
                    count++;
                }
            }
            ans = count;
        }

    }


    
}

int main() {
    int n;
    cin >> n;
    
    vec.resize(n);
    vec_ans.resize(n,-1);
    
    rep(i,n){
        int a;
        cin >> a;
        rep(j,a){
            int x, y;
            cin >> x >> y;
            x--;
            vec[i].pb(make_pair(x,y));
        }
        
    }    

    bit_full_search(n);

    cout << ans << endl;

}


Compiler output:
a.cc: In function 'void bit_full_search(int)':
a.cc:67:45: error: expected ')' before ';' token
   67 |             if(int k = 0; k < vec_ans.size(); k++){
      |               ~                             ^
      |                                             )
a.cc:67:47: error: 'k' was not declared in this scope
   67 |             if(int k = 0; k < vec_ans.size(); k++){
      |                                               ^
Language: C++

#include<iostream>
using namespace std;
int n;
int A[15][15];
int solve(int, int[]);
int main() {
    cin >> n;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            A[i][j] = 2;
        }
        int m;
        cin >> m;
        for (int j = 0; j < m; j++) {
            int x, y;
            cin >> x >> y;
            A[i][x - 1] = y;
        }
    }
    int b[n];
    for (int i = 0; i < n; i++) {
        b[i] = 2;
    }
    cout << solve(0, b) << endl;
}

int solve(int i, int b[]) {
    if (i == n - 1) {
        int count = 0;
        int check = 1;
        int never = 0;
        if (b[i] == 1 || b[i] == 2) {
            for (int j = 0; j < n; j++) {
                if (A[i][j] != 2 || A[i][j] != b[j]) {
                    b[i] = 0;
                }
            }
        }
        for (int j = 0; j < n; j++) {
            if (b[j] == 2) {
                never = max(solve(j, b), never);
            }
            if (b[j] == 1) {
                count++;
            }
        }
        if (never != 0) {
            return never;
        }
        return count;
    }
    int lie = 0;
    if (b[i] == 2) {
        b[i] = 0;
        int bnext = 0;
        for (int j = i + 1; j < n; j++) {
            if (b[j] == 1) {
                bnext = 1;
                lie = solve(j, b);
                break;
            }
        }
        if (bnext == 0) {
            lie = solve(n - 1, b);
        }
    }
    b[i] = 1;
    for (int j = 0; j < n; j++) {
        if (A[i][j] == 2 || A[i][j] == b[j]) {
            continue;
        } else if (b[j] == 2) {
            b[j] = A[i][j];
        } else if (A[i][j] != b[j]) {
            return 0;
        }
    }
    int next = 0;
    for (int j = i + 1; j < n; j++) {
        if (b[j] == 1) {
            next = j;
            break;
        }
    }
    if (next == 0) {
        return max(solve(n - 1, b), lie);
    }
    return max(max(solve(next, b), lie), never);
}


Compiler output:
a.cc: In function 'int solve(int, int*)':
a.cc:87:42: error: 'never' was not declared in this scope
   87 |     return max(max(solve(next, b), lie), never);
      |                                          ^~~~~
Language: C++

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

typedef pair<int, int> P;

int main(){

    int N;
    cin >> N;

    vector<vector<P>> PER(N);

    int tmp;

    for(int i=0;i<N;i++){
        cin >> tmp;
        for(int j=0;j<tmp;j++){
            int tmp1,tmp2;
            cin >> tmp1 >> tmp2;
            PER[i].push_back(P(tmp1,tmp2));
        }
    }

    int hyou[N][N];
    for(int i=0;i<N;i++){
        for(int j=0;j<N;j++){
            hyou[i][j] = 0;
        }
    }

    P T;

    int ans = N;

    for(int i=0;i<N;i++){
        for(int j=0;j<PER[i].size();j++){
            T = PER[i][j];
            if(hyou[i][T.first - 1] != 1000 and T.second == 1 and PER[T.first - 1].second == 0){
                ans--;
                hyou[i][T.first - 1] = 1000;
            }
            else if(hyou[i][T.first - 1] != 1000 and T.second == 0 and PER[T.first - 1].second == 0){
                ans--;
                hyou[i][T.first - 1] = 1000;
            }
        }
    }

    cout << ans << endl;



    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:84: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<std::pair<int, int> > >, std::vector<std::pair<int, int> > >::value_type' {aka 'class std::vector<std::pair<int, int> >'} has no member named 'second'
   38 |             if(hyou[i][T.first - 1] != 1000 and T.second == 1 and PER[T.first - 1].second == 0){
      |                                                                                    ^~~~~~
a.cc:42:89: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<std::pair<int, int> > >, std::vector<std::pair<int, int> > >::value_type' {aka 'class std::vector<std::pair<int, int> >'} has no member named 'second'
   42 |             else if(hyou[i][T.first - 1] != 1000 and T.second == 0 and PER[T.first - 1].second == 0){
      |                                                                                         ^~~~~~
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define repr(i,n) for(ll i=(n-1);i>=0;i--)
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
using namespace std;
ll INF = 1000000007;
using Graph = vector<vector<ll>>;

// 0 false, 1 true 
// stringの数字をint型にしてアスキーコードになったら -48する

vector<vector<pair<int,int>>> vec;
int ans = 0;

vector<int> vec_ans;

void bit_full_search(int n)
{
    //2^n回ループ
    for (int bit = 0; bit < (1<<n); ++bit) {
        vec_ans.resize(n,-1);
        queue<int> que;
        vector<int> true_man;
        ll count = 0;
        //cout << "{";
        for (int i = 0; i < n; ++i) {
            if (bit & (1<<i)) {
                //cout << " " << i << " ";
                true_man.pb(i);
                vec_ans[i] = 1;
                que.push(i);
                count++;
            }
        }
        //cout << "}" << endl;

        ll flag = 0;

        while(!que.empty()){
            int tmp = que.front();
            que.pop();

            for(int j = 0; j < vec[tmp].size(); j++){
                ll man = vec[tmp].at(j).first;
                ll say = vec[tmp].at(j).second;
                //cout << e << " " << man << " " << say << endl;
                if(vec_ans[man] != -1 && vec_ans[man] != say){
                    //cout << "dame" << endl;
                    flag = 1;
                    break;
                }else{
                    if(vec_ans[man] == -1 && say == 1){
                        que.push(man);
                    }
                    vec_ans[man] = say;
                }
            }
            if(flag == 1){
                break;
            }
        }

        if(flag == 0){
            if(int i = 0; i < vec_ans.size(); i++){
                if(vec_ans[i] == -1){
                    count++;
                }
            }
            ans = count;
        }

    }


    
}

int main() {
    int n;
    cin >> n;
    
    vec.resize(n);
    vec_ans.resize(n,-1);
    
    rep(i,n){
        int a;
        cin >> a;
        rep(j,a){
            int x, y;
            cin >> x >> y;
            x--;
            vec[i].pb(make_pair(x,y));
        }
        
    }    

    bit_full_search(n);

    cout << ans << endl;

}


Compiler output:
a.cc: In function 'void bit_full_search(int)':
a.cc:67:45: error: expected ')' before ';' token
   67 |             if(int i = 0; i < vec_ans.size(); i++){
      |               ~                             ^
      |                                             )
a.cc:67:47: error: 'i' was not declared in this scope
   67 |             if(int i = 0; i < vec_ans.size(); i++){
      |                                               ^
Language: C

#include<stdio.h>
#include<string.h>


int main(){
  char s[16];
  char t[16];
  int cnt=0;
  int N,a,i,j,x,y,k,l;
  scanf("%d",&N);
  for(i=0;i<N;i++){
   scanf("%d",&a);
    for(j=0;j<a;j++){
     scanf("%d %d",&x,&y);
      if(y=1)
        s[i] = x; //正直者
      for(k=0;k<N;k++){
       for(l=k;l<N;l++){
        if(s[k] == t[l])
        ++cnt;
       }
      }
     
      else
        t[i] = x; //不親切な人
    }
  }
  
  printf("%d",cnt);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:24:7: error: 'else' without a previous 'if'
   24 |       else
      |       ^~~~
Language: C++

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

int main(){
  
  int N;
  cin >> N;
  
  vector<int> A(N);
  vector<vector<int>> xy(N, vector<int>(N, 1));
  
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
    for (int j = 0; j < A.at(i); j++) {
      int x;
      cin >> x;
      cin >> xy.at(i, x);
    }
  }
  
  int count = N;
  
  for (int p = 0; p < N; p++) {
    for (int i = 0; i < N; i++) {
      int sum = 0;
      for (int j = 0; j < N; j++) {
        sum += xy.at(j).at(i);
      }
      if (sum == 0 || sum == N) {
        continue;
      } else {
        for (int k = 0; k < N; k++) {
          if (xy.at(k).at(i) == 0) {
            count--;
            for (int l = 0; l < N; l++) {
              xy.at(k).at(l) == 1;
            }
            break;
          }
        }
      }
    }
  }

        
      
      
  
  cout << count << endl;
  return 0;
    
    
  
  
  
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:17:19: error: no matching function for call to 'std::vector<std::vector<int> >::at(int&, int&)'
   17 |       cin >> xy.at(i, x);
      |              ~~~~~^~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1180:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::at(size_type) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; reference = std::vector<int>&; size_type = long unsigned int]'
 1180 |       at(size_type __n)
      |       ^~
/usr/include/c++/14/bits/stl_vector.h:1180:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1199:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::at(size_type) const [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; const_reference = const std::vector<int>&; size_type = long unsigned int]'
 1199 |       at(size_type __n) const
      |       ^~
/usr/include/c++/14/bits/stl_vector.h:1199:7: note:   candidate expects 1 argument, 2 provided
Language: C

#include"stdio.h"
#include"math.h"

int main() {
	//読み込み
	int n, a[15], x[15][15], y[15][15], ans = 0;
	scanf("%d", &n);
	for (int i = 0;i < n;i++) {
		scanf("%d", &a[i]);
		for (int j = 0;j < a[i];j++) {
			scanf("%d %d", &x[i][j], &y[i][j]);
		}
	}

	//全探査
	for (int i = (int)pow(n, 2) - 1;i >= 0;i++) {
		int binary[15], d;
		for (int j = 0;d > 0;j++) {
			binary[j] = d % 2;
			d /= 2;
		}

		int yosou[15][15];
		for(int j = 0;j < 15;j++) { for(int k = 0;k < 15;k++) { yosou[j][k] = -1; } }
		for(int j = 0;j < n;j++) {
			for(int k = 0;k < a[j];k++) {
				if (binary[j] == 1) { yosou[j][x[j][k]] = y[j][x[j][k]]; }
			
			else {
				yosou[j][x[j][k]] = y[j][x[j][k]] == 0 ? 1 : 0;
			}
		}

		int flag = 1;
		for(int j = 0;j < 15;j++) {
			for(int k = 0;k < 14;k++) {
				if (yosou[j][k] != -1 && yosou[j][k + 1] != -1 && yosou[j][k] != yosou[j][k + 1])flag = 0;
			}
		}
int c = 0;
		if (flag == 1) {
			
			for (int j = 0;j < n;j++) {
				if (binary[j] == 1)c++;
			}
		}
		if (c >= ans)ans = c;
	}
	printf("%d", ans);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:51:1: error: expected declaration or statement at end of input
   51 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
int n;
int A[15][15];
int solve(int, int[]);
int main() {
    cin >> n;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            A[i][j] = 2;
        }
        int m;
        cin >> m;
        for (int j = 0; j < m; j++) {
            int x, y;
            cin >> x >> y;
            A[i][x - 1] = y;
        }
    }
    int b[n];
    for (int i = 0; i < n; i++) {
        b[i] = 2;
    }
    cout << solve(0, b) << endl;
}

int solve(int i, int b[]) {
    if (i == n - 1) {
        int count = 0;
        int check = 1;
        int never = 0;
        if (b[i] == 1 || b[i] == 2) {
            for (int j = 0; j < n; j++) {
                if (A[i][j] != 2 || A[i][j] != b[j]) {
                    b[i] = 0;
                }
            }
        }
        for (int j = 0; j < n; j++) {
            if (b[j] == 2) {
                never = max(solve(j, b), never);
            }
            if (b[j] == 1) {
                count++;
            }
        }
        if (never != 0) {
            return never;
        }
        return count;
    }
    int lie = 0;
    if (b[i] == 2) {
        b[i] = 0;
        int bnext = 0;
        for (int j = i + 1; j < n; j++) {
            if (b[j] == 1) {
                bnext = 1;
                lie = solve(j, b);
                break;
            }
        }
        if (bnext == 0) {
            lie = max(solve(n - 1, b), bnever);
        }
    }
    b[i] = 1;
    for (int j = 0; j < n; j++) {
        if (A[i][j] == 2 || A[i][j] == b[j]) {
            continue;
        } else if (b[j] == 2) {
            b[j] = A[i][j];
        } else if (A[i][j] != b[j]) {
            return 0;
        }
    }
    int next = 0;
    for (int j = i + 1; j < n; j++) {
        if (b[j] == 1) {
            next = j;
            break;
        }
    }
    if (next == 0) {
        return max(solve(n - 1, b), lie);
    }
    return max(max(solve(next, b), lie), never);
}


Compiler output:
a.cc: In function 'int solve(int, int*)':
a.cc:64:40: error: 'bnever' was not declared in this scope
   64 |             lie = max(solve(n - 1, b), bnever);
      |                                        ^~~~~~
a.cc:87:42: error: 'never' was not declared in this scope
   87 |     return max(max(solve(next, b), lie), never);
      |                                          ^~~~~
Language: Java

n = int(input())
test = []
count = 0
for i in range(0, n):
    num_test = int(input())
    for j in range(0, num_test):
        answer = input().split()
        a = answer[1]
        if a == '1':
            count += 1
        else:
            continue
print(count)

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
n = int(input())
^
1 error
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#include<unordered_set>
#include<iomanip>
#include<cassert>
#include<regex>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 50;
 
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;
}
using namespace std;

void solve(){
    int n;
    cin>>n;
    vector<int>num(n);
    vector<vector<int>>x(n),y(n);
    int ans=0;
    rep(i,n){
      cin>>num[i];
      x[i].resize(num[i]);
      y[i].resize(num[i]);
      rep(j,num[i]){
        cin>>x[i][j]>>y[i][j];
      }
    }
    for(int i=0;i<(1<<n);++i){
      int cnt=0;
      bool flag=true;
      vector<int>a(n);
      vector<vector<int>>b(n);
      rep(j,n){
        if(i&1<<j){++cnt;a[j]=1;
        }
        rep(k,num[j]){
          if(a[j]){
            b[x[j][k]-1].pb(y[j][k]);
          }
          else {
            b[x[j][k]-1].pb(1-y[j][k]);
          }   
            }
      }
      rep(j,n){
        int cm=b[j].front();
        rep(k,b[j].size()){
            cm&=b[j][k];
        }
        rep(k,b[j].size())if(cm!=b[j][k]flag=false;
      }
      if(flag){
        chmax(ans,cnt);
      }
    }
    cout<<ans<<"\n";
}
 
int main(){
	ios::sync_with_stdio(false);
    cin.tie(0);
	cout<<fixed<<setprecision(15);
	solve();
	return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:78:41: error: expected ';' before 'flag'
   78 |         rep(k,b[j].size())if(cm!=b[j][k]flag=false;
      |                                         ^~~~
      |                                         ;
a.cc:79:7: error: expected primary-expression before '}' token
   79 |       }
      |       ^
a.cc:78:52: error: expected ')' before '}' token
   78 |         rep(k,b[j].size())if(cm!=b[j][k]flag=false;
      |                             ~                      ^
      |                                                    )
   79 |       }
      |       ~                                             
a.cc:79:7: error: expected primary-expression before '}' token
   79 |       }
      |       ^
Language: C++

#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <limits>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <map>

#define INF 100100100
#define rep(i,n) for(int i=0; i<(n); i++)
typedef long long ll;
using namespace std;

 
int main(){
    int n; cin >> n;
    
    vector<vector<int>> x(n, vector<int>());
    vector<vector<int>> y(n, vector<int>());
    rep(i,n){
        int A; cin >> A;
        rep(j,A){
            int a,b; cin >> a >> b;
            a--;
            x[i].push_back(a);
            y[i].push_back(b);
            
        }
    }
    int ans = 0;
    for(int tmp = 0; tmp < (1 << n); tmp++) {
        bitset<16> s(tmp);
        bool ok = true;
        for(int i=0; i<n; i++){
            if(s.test(i)){
                for(int j=0; j<x[i].size(); j++){
                    if(s.test(x[i][j])){
                        if(y[i][j] != 1){
                            ok = false;
                        }
                    }else{
                        if(y[i][j] != 0){
                            ok = false;
                        }
                    }
                }
            }
        }
        int t = s.count();
        if(ok){
            ans =max(ans,t);
            
        }
        
     
    }
     
    cout << ans << endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:9: error: 'bitset' was not declared in this scope
   37 |         bitset<16> s(tmp);
      |         ^~~~~~
a.cc:13:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
   12 | #include <map>
  +++ |+#include <bitset>
   13 | 
a.cc:37:20: error: 's' was not declared in this scope
   37 |         bitset<16> s(tmp);
      |                    ^
Language: C++

#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>



using namespace std;
int main(void){

  int n;

  cin >> n;

  int a[n];
  int x[n][n];
  int y[n][n];
  int i,j,k,l;
  int flag=1;//1 true  0 false

  for(i=0;i<n;i++){
    cin >> a[i];
    for(j=0;j<a[i];j++){
      cin >> x[i][j];
      x[i][j]=x[i][j]-1;
      cin >> y[i][j];
    }
  }
  int ans=0;//this will be an answer
  //一人ずつそいつが正直者であると仮定して、矛盾があればつぎにいく
  for(i=0;i<n;i++){
    for(j=0;j<a[i];j++){
      for(k=0;k<n;k++){
        if(k!=i){
        for(l=0;l<a[k];l++){
          if(i==x[k][l]){
            if(y[i][j]==1&&y[k][l]==1){
              flag=1;
              //cout << "mondai2\n";
              //cout << i <<j<<k<<l;
            }
            else if(y[i][j]==1&&y[k][l]==0){
              flag=0;
              //cout << "mondai1\n";
              //cout << i <<j<<k<<l;
              break;
            }
            else if(y[i][j]==0)&&y[k][l]==1){
              flag=0;
              //cout << "mondai1\n";
              //cout << i <<j<<k<<l;
              break;
            }

        }

          }
          if(flag==0){
            break;
          }
      }
      if(flag==0){
        break;
      }
    }
    }

    flag=1;


  }
  if(n==2){

  }
  cout << ans;


  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:35: error: expected ';' before '[' token
   49 |             else if(y[i][j]==0)&&y[k][l]==1){
      |                                   ^
      |                                   ;
a.cc:49:34: error: label 'y' used but not defined
   49 |             else if(y[i][j]==0)&&y[k][l]==1){
      |                                  ^
Language: C++

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



int main(void) {
	int n, a, x[15][14], y[15][14];
	int a = 0, b = 0;
	cin >> n;
	for (int i = 0; i < n; ++i) {
		cin >> a;
		for (int j = 0; j < a; ++j) {
			cin >> x[i][j] >> y[i][j];
			if (y[i][j]) {
				++a;
			}
			else {
				++b;
			}
		}
	}
	cout << n - (a + b) / 2;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: redeclaration of 'int a'
    9 |         int a = 0, b = 0;
      |             ^
a.cc:8:16: note: 'int a' previously declared here
    8 |         int n, a, x[15][14], y[15][14];
      |                ^
Language: C++

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

int main(){
    int N;
    cin >> N;
    for(int i = 0;i < N;i++){
        int A,cnt = 0;
        cin >> A;
        for(int j = 0;j < A;j++){
            int x,y;
            cin >> x >> y;
            if(y == 1) cnt++;
    }
    if(cnt == 0) cout << '1';
    else cout << cnt;
    return 0;
}

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

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

int main(){
    int N;
    cin >> N;
    for(int i = 0;i < N;i++){
        int A,cnt = 0;
        cin >> A;
        for(int j = 0;j < A;j++){
            int x,y;
            cin >> x >> y;
            if(y == 1) cnt++
    }
    if(cnt == 0) cout << '1';
    else cout << cnt;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:29: error: expected ';' before '}' token
   14 |             if(y == 1) cnt++
      |                             ^
      |                             ;
   15 |     }
      |     ~                        
a.cc:19:2: error: expected '}' at end of input
   19 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

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

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  vector<vector<pair<int, int>>> xy(n, vector<pair<int, int>>(0));

  // |- a[i]
  // |    |--xy<pair>
  // |    |--xy<pair>
  // |
  // |- a[i + 1];


  int input[2];
  int i, j, k;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    for (j = 0; j < a[i]; j++) {
      cin >> input[0] >> input[1];
      xy[i].push_back(make_pair(input[0] - 1, input[1]));
    }
  }
  // cout << endl;
  for (i = 0; i < xy.size(); i++) {
    for (j = 0; j < xy[i].size(); j++) {
      // cout << xy[i][j].first << ' ' << xy[i][j].second << endl;
    }
  }
  // /*
  int result = 0;
  bool flag = true;
  for (i = 0; i < pow(2, n); i++) {
    flag = true;
    vector<int> b(n);
    int temp = i;
    int t_sum = 0;
    for (j = 0; j < b.size(); j++) {
      b[j] = temp % 2;
      temp /= 2;
      t_sum += b[j];
      // cout << b[j] << ' ';
    }
    // cout << endl;
    for (j = 0; j < n; j++) {
      // cout << "test ";
      // cout << "j " << j << ' ';
      if (b[j]) {
        // cout << xy[j].size() << ' ';
        for (k = 0; k < xy[j].size(); k++) {
          // cout << k << ' ';
          // cout << "a " << a[j] << " k " << k << ' ' << b[xy[j][k].first] << " [" << xy[j][k].first << "] " << xy[j][k].second << endl;
          if (b[xy[j][k].first] != xy[j][k].second) {
            flag = false;
          }
        }
      } else {
        // cout << xy[j].size() << ' ';
        for (k = 0; k < xy[j].size(); k++) {
          // cout << k << ' ';
          // cout << "a " << a[j] << " k " << k << " " <<  b[xy[j][k].first] << "     [" << xy[j][k].first << "] " << xy[j][k].second << endl;
          if (b[xy[j][k].first] == xy[j][k].second) {
            flag = false;
          }
        }
      }
      // cout << endl;
    }
    if (flag) {
      result = max(result, t_sum);
      // for (j = 0; j < b.size(); j++) {
        // cout << b[j] << ' ';
      // }
      // cout << endl;
    }
  }
  cout << result << endl;
  //*/
  return 0;
}


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

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

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		Person[] persons = new Person[N];
		for (int i = 0; i < N; i++) {
			int A = in.nextInt();
			Person person = new Person();
			int[] tes = new int[N];
			Arrays.fill(tes, -1);
			tes[i] = 1;
			for (int j = 0; j < A; j++) {
				tes[in.nextInt() - 1] = in.nextInt();
			}
			person.tes = tes;
			persons[i] = person;
		}
		int ans = 0;
		for (int i = 0; i < persons.length; i++) {
			boolean isOk = true;
			int[] t = new int[N];
			System.arraycopy(persons[i].tes, 0, t, 0, N);
			for (int j = 0; j < persons.length; j++) {
				if (i == j || t[j] == -1 || t[j] == 0) {
					continue;
				}
				for (int j2 = 0; j2 < N; j2++) {
					if (t[j2] == -1 && persons[j].tes[j2] == 1) {
						t[j2] = 1;
					} else if ((persons[i].tes[j2] != -1 && persons[j].tes[j2] != -1)
							&& persons[i].tes[j2] != persons[j].tes[j2]) {
						isOk = false;
						break;
					}
				}
				if (!isOk) {
					break;
				}

			}
			int max = 0;
			if (isOk) {
				for (int j = 0; j < t.length; j++) {
					if (t[j] == 1) {
						max++;
					}
				}
			}
			ans = Math.max(ans, max);
		}
		System.out.println(ans);
		in.close();

	}
}

public class Person {

	int[] tes;

}

Compiler output:
Main.java:61: error: class Person is public, should be declared in a file named Person.java
public class Person {
       ^
1 error
Language: Java

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

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		Person[] persons = new Person[N];
		for (int i = 0; i < N; i++) {
			int A = in.nextInt();
			Person person = new Person();
			int[] tes = new int[N];
			Arrays.fill(tes, -1);
			tes[i] = 1;
			for (int j = 0; j < A; j++) {
				tes[in.nextInt() - 1] = in.nextInt();
			}
			person.tes = tes;
			persons[i] = person;
		}
		int ans = 0;
		for (int i = 0; i < persons.length; i++) {
			boolean isOk = true;
			int[] t = new int[N];
			System.arraycopy(persons[i].tes, 0, t, 0, N);
			for (int j = 0; j < persons.length; j++) {
				if (i == j || t[j] == -1 || t[j] == 0) {
					continue;
				}
				for (int j2 = 0; j2 < N; j2++) {
					if (t[j2] == -1 && persons[j].tes[j2] == 1) {
						t[j2] = 1;
					} else if ((persons[i].tes[j2] != -1 && persons[j].tes[j2] != -1)
							&& persons[i].tes[j2] != persons[j].tes[j2]) {
						isOk = false;
						break;
					}
				}
				if (!isOk) {
					break;
				}

			}
			int max = 0;
			if (isOk) {
				for (int j = 0; j < t.length; j++) {
					if (t[j] == 1) {
						max++;
					}
				}
			}
			ans = Math.max(ans, max);
		}
		System.out.println(ans);
		in.close();

	}
}

Compiler output:
Main.java:9: error: cannot find symbol
		Person[] persons = new Person[N];
		^
  symbol:   class Person
  location: class Main
Main.java:9: error: cannot find symbol
		Person[] persons = new Person[N];
		                       ^
  symbol:   class Person
  location: class Main
Main.java:12: error: cannot find symbol
			Person person = new Person();
			^
  symbol:   class Person
  location: class Main
Main.java:12: error: cannot find symbol
			Person person = new Person();
			                    ^
  symbol:   class Person
  location: class Main
4 errors
Language: Java

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

public class Main {
	public static void main(String[] args) throws IOException {
		try (BufferedReader in =
new BufferedReader(new InputStreamReader(System.in))) {
			
String line;
line = in.readLine();

int n = Integer.parseInt(line);

int[][] sayTable = new int[n][];
for (int i = 0; i < n; ++i) {
line = in.readLine();
int a = Integer.parseInt(line);
sayTable[i] = new int[a];
for (int j = 0; j < a; ++j) {
line = in.readLine();
String[] params = line.split(" ");
	int x = Integer.parseInt(params[0]) - 1;
	int y = Integer.parseInt(params[1]);
		sayTable[i][x] = y + 1;
	}
}
int maxHonest = search(say, new int[n], 0);
System.out.println(maxHonest);
}
	}

	public static int search(
int[][] sayTable, int[] honest, int i) {

		if (i >= sayTable.length) {
			return (int) Arrays.stream(honest)
.filter(say -> say == 2)
.count();
		}

		int[] sayArray = sayTable[i];

		int count = 0;
		{
		if (checkHonest(honest, sayArray)) {
		int[] copyHonest = Arrays.copyOf(honest, honest.length);
int c = search(sayTable, copyHonest, i + 1);
count = Math.max(c, count);
		}
	}
	{
		if (checkUnkind(honest, sayArray)) {
		int[] copyHonest = Arrays.copyOf(honest, honest.length);
int c = search(sayTable, copyHonest, i + 1);
count = Math.max(c, count);
		}
	}
return count;
}



	public static boolean checkHonest(int[] honest, int[] sayArray) {
		for (int i = 0; i < sayArray.length; ++i) {
			int say = sayArray[i];
			if (say < 0) {
				continue;
			}
			int h = honest[i];
			if (h != 0 || h != say) {
return false;				
			}
		}
return true;
	}

	public static boolean checkUnkind(int[] honest, int[] sayArray) {
		for (int i = 0; i < sayArray.length; ++i) {
			int say = sayArray[i];
			if (say < 0) {
				continue;
			}
			int h = honest[i];
			if (h != 0 || h == say) {
return false;				
			}
		}
return true;
	}

public static void setHonest(int[] honest, int[] sayArray) {
		for (int i = 0; i < sayArray.length; ++i) {
			int say = sayArray[i];
			if (say == 1) {
				honest[i] = 1;
			} else if (say == 2) {
				honest[i] = 2;
			}
		}
	}

	public static void setUnkind(int[] honest, int[] sayArray) {
		for (int i = 0; i < sayArray.length; ++i) {
			int say = sayArray[i];
			if (say == 1) {
				honest[i] = 2;
			} else if (say == 2) {
				honest[i] = 1;
			}
		}
	}
}



Compiler output:
Main.java:27: error: cannot find symbol
int maxHonest = search(say, new int[n], 0);
                       ^
  symbol:   variable say
  location: class Main
1 error
Language: Java

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

public class Main {
	public static void main(String[] args) throws IOException {
		try (BufferedReader in =
new BufferedReader(new InputStreamReader(System.in))) {
			
String line;
line = in.readLine();

int n = Integer.parseInt(line);

int[][] sayTable = new int[n][];
for (int i = 0; i < n; ++i) {
line = in.readLine();
int a = Integer.parseInt(line);
sayTable[i] = new int[a];
for (int j = 0; j < a; ++j) {
line = in.readLine();
String[] params = line.split(" ");
	int x = Integer.parseInt(params[0]) - 1;
	int y = Integer.parseInt(params[1]);
		sayTable[i][x] = y + 1;
	}
}
int maxHonest = search(say, new int[n]);
System.out.println(maxHonest);
}
	}

	public static int search(
int[][] sayTable, int[] honest, int i) {

		if (i >= sayTable.length) {
			return (int) Arrays.stream(honest)
.filter(say -> say == 2)
.count();
		}

		int[] sayArray = sayTable[i];

		int count = 0;
		{
		if (checkHonest(honest, sayArray)) {
		int[] copyHonest = Arrays.copyOf(honest, honest.length);
int c = search(sayTable, copyHonest, i + 1);
count = Math.max(c, count);
		}
	}
	{
		if (checkUnkind(honest, sayArray)) {
		int[] copyHonest = Arrays.copyOf(honest, honest.length);
int c = search(sayTable, copyHonest, i + 1);
count = Math.max(c, count);
		}
	}
return count;
}



	public static boolean checkHonest(int[] honest, int[] sayArray) {
		for (int i = 0; i < sayArray.length; ++i) {
			int say = sayArray[i];
			if (say < 0) {
				continue;
			}
			int h = honest[i];
			if (h != 0 || h != say) {
return false;				
			}
		}
return true;
	}

	public static boolean checkUnkind(int[] honest, int[] sayArray) {
		for (int i = 0; i < sayArray.length; ++i) {
			int say = sayArray[i];
			if (say < 0) {
				continue;
			}
			int h = honest[i];
			if (h != 0 || h == say) {
return false;				
			}
		}
return true;
	}

public static void setHonest(int[] honest, int[] sayArray) {
		for (int i = 0; i < sayArray.length; ++i) {
			int say = sayArray[i];
			if (say == 1) {
				honest[i] = 1;
			} else if (say == 2) {
				honest[i] = 2;
			}
		}
	}

	public static void setUnkind(int[] honest, int[] sayArray) {
		for (int i = 0; i < sayArray.length; ++i) {
			int say = sayArray[i];
			if (say == 1) {
				honest[i] = 2;
			} else if (say == 2) {
				honest[i] = 1;
			}
		}
	}
}



Compiler output:
Main.java:27: error: cannot find symbol
int maxHonest = search(say, new int[n]);
                       ^
  symbol:   variable say
  location: class Main
1 error
Language: Java

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

public class Main {
	public static void main(String[] args) throws IOException {
		try (BufferedReader in =
new BufferedReader(new InputStreamReader(System.in))) {
			
String line;
line = in.readLine();

int n = Integer.parseInt(line);

int[][] sayTable = new int[n][];
for (int i = 0; i < n; ++i) {
line = in.readLine();
int a = Integer.parseInt(line);
sayTable[i] = new int[a];
for (int j = 0; j < a; ++j) {
line = in.readLine();
String[] params = line.split(" ");
	int x = Integer.parseInt(params[0]) - 1;
	int y = Integer.parseInt(params[1]);
		sayTable[i][x] = y + 1;
	}
}
int maxHonest = search(say, new int[n]);
System.out.println(maxHonest);
}
	}

	public static int search(
int[][] sayTable, int[] honest, int i) {

		if (i >= sayTable.length) {
			return (int) Arrays.stream(honest)
.filter(say -> say == 2)
.count();
		}

		int[] sayArray = sayTable[i];

		int count = 0;
		{
		if (checkHonest(honest, sayArray)) {
		int[] copyHonest = Arrays.copyOf(honest, honest.length);
int c = search(sayTable, copyHonest, i + 1);
count = Math.max(c, count);
		}
	}
	{
		if (checkUnkind(honest, sayArray)) {
		int[] copyHonest = Arrays.copyOf(honest, honest.length);
int c = search(sayTable, copyHonest, i + 1);
count = Math.max(c, count);
		}
	}
return count;
}



	public static boolean checkHonest(int[] honest, int[] sayArray) {
		for (int i = 0; i < sayArray.length; ++i) {
			int say = sayArray[i];
			if (say < 0) {
				continue;
			}
			int h = honest[i];
			if (h == 0 || h != say) {
return false;				
			}
		}
return true;
	}

	public static boolean checkUnkind(int[] honest, int[] sayArray) {
		for (int i = 0; i < sayArray.length; ++i) {
			int say = sayArray[i];
			if (say < 0) {
				continue;
			}
			int h = honest[i];
			if (h == 0 || h == say) {
return false;				
			}
		}
return true;
	}

public static boolean setHonest(int[] honest, int[] sayArray) {
		for (int i = 0; i < sayArray.length; ++i) {
			int say = sayArray[i];
			if (say == 1) {
				honest[i] = 1;
			} else if (say == 2) {
				honest[i] = 2;
			}
		}
return true;
	}

	public static boolean setUnkind(int[] honest, int[] sayArray) {
		for (int i = 0; i < sayArray.length; ++i) {
			int say = sayArray[i];
			if (say == 1) {
				honest[i] = 2;
			} else if (say == 2) {
				honest[i] = 1;
			}
		}
return true;
	}
}


Compiler output:
Main.java:27: error: cannot find symbol
int maxHonest = search(say, new int[n]);
                       ^
  symbol:   variable say
  location: class Main
1 error
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
#ifdef  DEBUG
  ifstream in("input.txt");
  cin.rdbuf(in.rdbuf());
#endif  // for local.
  int n;
  int wild = 0;
  for (int bit = 0; bit < n; bit++) {
    wild |= (1<<bit);
  }
  int m[n];
  int ns;
  int x, y;
  for (int i = 0; i < n; i++) {
    int m[i] = wild;
    cin >> ns;
    for (int j = 0; j < ns; j++) {
      cin >> x >> y;
      m[i] &= (y<<(x-1));
    }
  }

  int a;
  int ans = 0;
  for (int i = 0; i < wild; i++) {
    a = wild;
    for (int j = 0; j < n; j++) {
      if (i & (1<<j)) {
        a &= m[j];
      } else {
        a &= wild;
      }
    }
    if (a == i) {
      if (__builtin_popcount(a) > ans ) {
        ans = __builtin_popcount(a);
      }
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:16: error: array must be initialized with a brace-enclosed initializer
   19 |     int m[i] = wild;
      |                ^~~~
Language: C++

#include <bits/stdc++.h>
#define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++)

int array[ 15 ][ 15 ];
int n;
std::vector <int> vec_rec;
int index = 0;
bool check( int a ){
	for(int i = 0; i < vec_rec.size() - 1; i++){
		if(vec_rec[ i ] == a){
			vec_rec.erase(vec_rec.begin() + i);
			array[ a ][ 0 ] = 100;
			return true;
		}
	}
	rep( i, 0, n ){
		for(int j = 0; array[ i ][ j ] != 100; j++){
			if(array[ i ][ j ] == -( a + 1 )){
				// printf("%d, %d, (%d, %d)\n",array[i][j], a, i, j);
				if (i == a){
					array[ a ][ 0 ] = 100;
					return true;
				}
				vec_rec.push_back( i );
				if (check( i )){
					array[ a ][ 0 ] = 100;
					return true;
				}
			}
		}
	}
	return false;
}

int main( void ){
	if (!scanf( "%d", &n )){
		return -1;
	}
	rep( i, 0, n ){
		int k;
		if (!scanf( "%d", &k )){
			return -1;
		}
		array[ i ][ k ] = 100;
		rep( j, 0, k ){
			int a, b;
			if (!scanf( "%d%d", &a, &b )){
				return -1;
			}
			if (b == 0)
				a = -a;
			array[ i ][ j ] = a;
		}
	}
	// rep( i, 0, n ){
	// 	rep( j, 0, n ){
	// 		printf( "%d, ", array[ i ][ j ] );
	// 	}
	// 	printf( "\n" );
	// }
	rep( i, 0, n ){
		vec_rec.push_back( i );
		check( i );
	}
	int count=0;
	rep(i,0,n){
		if(array[i][0] != 100)
			count++;
	}
	printf("%d\n", count);
	// rep( i, 0, n ){
	// 	rep( j, 0, n ){
	// 		printf( "%d, ", array[ i ][ j ] );
	// 	}
	// 	printf( "\n" );
	// }
	return 0;
}


Compiler output:
a.cc:7:5: error: 'int index' redeclared as different kind of entity
    7 | int index = 0;
      |     ^~~~~
In file included from /usr/include/string.h:462,
                 from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, int)'
   50 | extern const char *index (const char *__s, int __c)
      |                    ^~~~~
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
using namespace std;
typedef long long ll;

int main(){
  int n,ans = 0;cin >> n;
  int a[n],x[n][n],y[n][n];
  map<int,int> 
  rep(i,n){
    cin >> a[i];
    rep(j,a[i]){
      cin >> x[i][j] >> y[i][j];
      if(m[x[i][j]] != 0 && m[x[i][j]] != y[i][j]+1)ans += 1;
      else m[x[i][j]] = y[i][j] + 1;
    }
  }
  if(ans == 0)cout << n-1 << endl;
  else cout << n-ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:18: error: expected unqualified-id before 'for'
    2 | #define rep(i,n) for(int i=0;i<(n);++i)
      |                  ^~~
a.cc:10:3: note: in expansion of macro 'rep'
   10 |   rep(i,n){
      |   ^~~
a.cc:10:7: error: 'i' was not declared in this scope
   10 |   rep(i,n){
      |       ^
a.cc:2:30: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0;i<(n);++i)
      |                              ^