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

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
using namespace std;
typedef long long ll;
typedef pair<int, int>P;
//max=({});
//条件式が真ならwhileの中身を回し続ける

int g[15][15];
bool flag[1050000];
const int INF = 1001001001;
const int di[] = { -1,0,1,0 };
const int dj[] = { 0,-1,0,1 };

int main() {
	int n;
	cin >> n;
	rep(i, n)rep(j, n) {
		g[i][j] = -1;
	}
	rep(i, n) {
		int m;
		cin >> m;
		rep(j, m) {
			int a, x;
			cin >> a >> x;
			--a;
			g[i][a] = x;
		}
	}
	int ans = 0;
	rep(i, 1 << n) {
		vector<int>d(n);
		rep(j, n) {
			if (i >> j & 1) {
				d[j] = 1;
			}
			bool ok = true;
			if (d[j]) {
				rep(k, n) {
					if (g[j][k] == -1)continue;
					if (g[j][k] != d[k])ok = false;
				}
			}
		}
		if (ok)ans = max(ans, __builtin_popcount(i));
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:47:21: error: 'ok' was not declared in this scope
   47 |                 if (ok)ans = max(ans, __builtin_popcount(i));
      |                     ^~
Language: C++

#include <iostream> // cin, cout, cerr
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota
#include <cstdio> // printf, scanf
#include <string> // string, stoi, to_string
#include <vector> // vector
#include <queue> // queue, priority_queue
#include <deque> // deque
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <iomanip> // cout<<setprecision(n)
#include <functional> // function<void(int)>
#include <cmath>

#ifdef DEBUG
#include "debug.hpp"
#else
#define debug(...)
#endif

#define int long long // at least int64 > 9*10^18
#define ENDL '\n'
#define rep(i,n) for(int i = 0; i < (n); i++)
#define print(i) std::cout << (i) << '\n'
#define all(v) (v).begin(), (v).end()
/* libraries */

struct T
{
	int x,y;
	T(int x, int y) : x(x), y(y) {}
};

signed main() {
	int n;
	std::cin >> n;
	std::vector<std::vector<T> > a(n,std::vector<T>());
	rep(i,n) {
		int m;
		std::cin >> m;
		rep(j,m) {
			int x,y;
			std::cin >> x >> y;
			a[i].emplace_back(x-1,y);
		}
	}

	int max = 0;
	for(int x=0;x<(1<<n);x++) {
		// check if valid
		std::bitset<15> xx = x;
		bool valid = true;
		rep(i,n) {
			if(xx[i]) for(auto t:a[i]) {
				if(xx[t.x]!=t.y) {
					valid = false;
					break;
				}
			}
			if(!valid) break;
		}
		if(!valid) continue;
		max = std::max(max,(int)xx.count());
	}
	print(max);

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:51:22: error: 'bitset' is not a member of 'std'
   51 |                 std::bitset<15> xx = x;
      |                      ^~~~~~
a.cc:14:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
   13 | #include <cmath>
  +++ |+#include <bitset>
   14 | 
a.cc:51:33: error: 'xx' was not declared in this scope; did you mean 'x'?
   51 |                 std::bitset<15> xx = x;
      |                                 ^~
      |                                 x
Language: C

#include <iostream>

using namespace std;

int bitcount(uint64_t b) {
    b = (b & 0x55555555) + (b >> 1 & 0x55555555);
    b = (b & 0x33333333) + (b >> 2 & 0x33333333);
    b = (b & 0x0f0f0f0f) + (b >> 4 & 0x0f0f0f0f);
    b = (b & 0x00ff00ff) + (b >> 8 & 0x00ff00ff);
    return (b & 0x0000ffff) + (b >> 16);
}

int main()
{
	int N, A[20], x[20][20], y[20][20];
	cin >> N;
	for(int n=0; n<N; n++){
		cin >> A[n];
		for(int a=0; a<A[n]; a++){
			cin >> x[n][a] >> y[n][a];
		}
	}

	int res = 0;
	for(uint64_t bf=0; bf<(0x01ULL << N); bf++){
		bool sat = true;
		for(int n=0; n<N; n++){
			if(bf & (0x01ULL << n)){
				for(int a=0; a<A[n]; a++){
					if(((bf >> (x[n][a]-1)) & 0x01ULL) ^ y[n][a]){
						sat = false;
					}
				}
			} else {
				continue;
			}
		}
		if(sat){
			res = max(res, bitcount(bf));
		}
	}

	cout << res;
}


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

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

bool f(int& c, vector<pair<int, int>>& p) 
{
	for (auto& i : p) {
		if ((1 << (i.first - 1)) & c) {
			if (i.second == 0) {
				return false;
			}
		}
		else {
			if (i.second == 1) {
				return false;
			}
		}
	}
	return true;
}

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

	vector<vector<pair<int, int>>> axy(n);

	for (int i = 0; i < n; ++i) {
		int a;
		cin >> a;
		axy[i].resize(a);
		for (int j = 0; j < a; ++j) {
			cin >> axy[i][j].first >> axy[i][j].second;
		}
	}

	int c = 1;
	int end = pow(2,n);
	int ret = 0;
	while (c < end) {
		bool isOK = true;
		int count = 0;
		for (int i = 0; i < n; ++i) {
			if ((1 << i) & c) {
				++count;
				if (!f(c, axy[i])) {
					isOK = false;
					break;
				}
			}
		}

		if (isOK) {
			if (ret < count) {
				ret = count;
			}
		}

		++c;
	}

	cout << ret << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:19: error: 'pow' was not declared in this scope
   39 |         int end = pow(2,n);
      |                   ^~~
Language: C++

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

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
typedef vector<int> vi;
typedef vector<vi> vvi;
inline int in() { int x; cin >> x; return x; }

void solve() {
  int n = in();
  vvi x(n), y(n);
  vi a(n);
  FOR(i,0,n) {
    a[i] = in();
    x[i].resize(a[i]);
    y[i].resize(a[i]);
    FOR(j,0,a[i]) {
      x[i][j] = in()-1;
      y[i][j] = in();
    }
  }
  int ans = 0;
  FOR(i,1,1<<n) {
    vi honest(n);
    FOR(j,0,n) honest[j] = i>>j & 1;
    int ok = 1;
    FOR(j,0,n) if (honest[j]==1)
      FOR(k,0,a[j]) if (y[j][k]!=honest[x[j][k]]) ok = 0;
    if (ok) ans = max(ans, __builtin_popcount(i));
  }
  cout << ans << endl;
}

#undef int
int main() {
  solve();
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:31:22: error: no matching function for call to 'max(ll&, int)'
   31 |     if (ok) ans = max(ans, __builtin_popcount(i));
      |                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:31:22: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   31 |     if (ok) ans = max(ans, __builtin_popcount(i));
      |                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:31:22: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   31 |     if (ok) ans = max(ans, __builtin_popcount(i));
      |                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
typedef vector<int> vi;
typedef vector<vi> vvi;
inline int in() { int x; cin >> x; return x; }
#define chmax(x,y) x = max(x,y)

void solve() {
  int n = in();
  vvi x(n), y(n);
  vi a(n);
  FOR(i,0,n) {
    a[i] = in();
    x[i].resize(a[i]);
    y[i].resize(a[i]);
    FOR(j,0,a[i]) {
      x[i][j] = in()-1;
      y[i][j] = in();
    }
  }
  int ans = 0;
  FOR(i,1,1<<n) {
    vi honest(n);
    FOR(j,0,n) honest[j] = i>>j & 1;
    int ok = 1;
    FOR(j,0,n) if (honest[j]==1)
      FOR(k,0,a[j]) if (y[j][k]!=honest[x[j][k]]) ok = 0;
    if (ok) maxs(ans, __builtin_popcount(i));
  }
  cout << ans << endl;
}

#undef int
int main() {
  solve();
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:32:13: error: 'maxs' was not declared in this scope
   32 |     if (ok) maxs(ans, __builtin_popcount(i));
      |             ^~~~
Language: C++

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

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
typedef vector<int> vi;
typedef vector<vi> vvi;
inline int in() { int x; cin >> x; return x; }

void solve() {
  int n = in();
  vvi x(n), y(n);
  vi a(n);
  FOR(i,0,n) {
    a[i] = in();
    x[i].resize(a[i]);
    y[i].resize(a[i]);
    FOR(j,0,a[i]) {
      x[i][j] = in()-1;
      y[i][j] = in();
    }
  }
  int ans = 0;
  FOR(i,1,1<<n) {
    vi honest(n);
    FOR(j,0,n) honest[j] = i>>j & 1;
    int ok = 1;
    FOR(j,0,n) if (honest[j]==1)
      FOR(k,0,a[j]) if (y[j][k]!=honest[x[j][k]]) ok = 0;
    if (ok) maxs(ans, __builtin_popcount(i));
  }
  cout << ans << endl;
}

#undef int
int main() {
  solve();
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:31:13: error: 'maxs' was not declared in this scope
   31 |     if (ok) maxs(ans, __builtin_popcount(i));
      |             ^~~~
Language: C++

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

int main() {
  int n, m = 0;
  cin >> n;
  vector<vector<pair<int, bool>>> v(n, vector<pair<int, bool>>);
  rep(i, n){
    int a;
    cin >> a;
    rep(j, a){
      int b;
      bool c;
      cin >> b >> c;
      v[i].push_back(make_pair(b, c));
    }
  }
  rep(i, (1 << n)){
    int d = 0;
    bool e = 1;
    rep(j, n){
      if(i && (1 << j)){
        ++d;
        for(auto p: v[j]){
          if((p.second && i && (1 << p.first)) || (!p.second && i && !(1 << p.first))) continue;
          else{
            e = 0;
            break;
          }
        }
        if(!e) break;
      }
    }
    if(e) m = max(m, d);
  }
  cout << m << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:63: error: expected primary-expression before ')' token
    9 |   vector<vector<pair<int, bool>>> v(n, vector<pair<int, bool>>);
      |                                                               ^
Language: C++

int N;
int A[20];
int x[20][20];
int y[20][20];
 
int counter(int x) {
    if(x == 0) return 0;
    return counter(x >> 1) + (x & 1);
}
 
void solve() {
    cin >> N;
    for(int i = 1; i <= N; i++) {
        cin >> A[i];
        for(int j = 1; j <= A[i]; j++) {
            cin >> x[i][j] >> y[i][j];
        }
    }
    int ans = 0;
    for(int bits = 1; bits < (1 << N); bits++) {
        bool ok = true;
        for(int i = 1; i <= N; i++) {
            if(!(bits & (1 << (i-1)))) continue;
            for(int j = 1; j <= A[i]; j++) {
                if(((bits >> (x[i][j]-1)) & 1) ^ y[i][j]) ok = false;
            }
        }
        if(ok) ans = max(ans, counter(bits));
    }
    cout << ans << endl;
    return;
}
 
int main() {
    solve();
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:12:5: error: 'cin' was not declared in this scope
   12 |     cin >> N;
      |     ^~~
a.cc:28:22: error: 'max' was not declared in this scope
   28 |         if(ok) ans = max(ans, counter(bits));
      |                      ^~~
a.cc:30:5: error: 'cout' was not declared in this scope
   30 |     cout << ans << endl;
      |     ^~~~
a.cc:30:20: error: 'endl' was not declared in this scope
   30 |     cout << ans << endl;
      |                    ^~~~
Language: C++

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

ll main() {
  ll N;
  cin>>N;
  vector<vector<pair<ll,ll>>> list(N);
  for(ll i=0;i<N;i++){
    ll A;
    cin>>A;
    for(ll j=0;j<A;j++){
      ll x,y;
      cin>>x>>y;
      list.at(i).push_back({x-1,y});
    }
  }
  
  ll ans=0;
  
  for(ll tmp=0;tmp<(1<<15);tmp++){
    bitset<15> s(tmp);
    bool judge=true;
    ll count=0;
    for(ll i=0;i<N;i++){
      if(s.test(i)==1){//iは正直
        count++;
        for(ll j=0;j<list.at(i).size();j++){
          if(s.test(list.at(i).at(j).first) != list.at(i).at(j).second){
            judge=false;
            break;
          }
        }
      }
      else{//iは嘘つき
        for(ll j=0;j<list.at(i).size();j++){
          if(s.test(list.at(i).at(j).first) == list.at(i).at(j).second){
            judge=false;
            break;
          }
        }
      }
    }
    if(judge){ans=max(count,ans);}
  }
  cout<<ans<<endl;
}




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

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

int main() {
	int N;
	int A[20];
	int x[20][20];
	int y[20][20];

	cin >>N;
	for(int i=1;i<=N;i++){
		cin >>A[i];
		for(int j=1;j<=A[i];j++){
			cin >>x[i][j]>>y[i][j];
		}
	}

	int ans = 0;
    for(int bits = 1; bits < (1 << N); bits++) {
        bool ok = true;
        for(int i = 1; i <= N; i++) {
            if(!(bits & (1 << (i-1)))) continue;
            for(int j = 1; j <= A[i]; j++) {
                if(((bits >> (x[i][j]-1)) & 1) ^ y[i][j]) ok = false;
            }
        }
        if(ok) ans = max(ans, counter(bits));
    }
    cout << ans << endl;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:31: error: 'counter' was not declared in this scope
   27 |         if(ok) ans = max(ans, counter(bits));
      |                               ^~~~~~~
Language: C++

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

int main(){
  int n;
  cin >> n;
  vector<vector<int>> g(n,vector<int>(n));
  rep(i,n)rep(j,n) g[i][j] = -1;
  rep(i,n){
    int m;
    cin >>m;
    rep(j,m){
      int a, x;
      cin >> a >>x;
      --a;
      g[i][a] = x;
    }
  }
  int ans = 0;
  rep(i,i<<n) {
    vector<int> d(n);
    rep(j,n) if( i>>j&1 ) d[j] = 1;
    bool ok = true;
    rep(j,n) {
      if (d[j]){
        rep(k,n){
          if (g[j][k] == -1 ) continue;
          if (g[j][k] != d[k]) ok = false;
        }
      }
    }
    if (ok) ans = max(ans,__builtin_popcount(i));

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

Compiler output:
a.cc:4:14: error: declaration does not declare anything [-fpermissive]
    4 | typedef long long;
      |              ^~~~
Language: C++

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

#define int long long
pair<int,int> b[55][55];

signed main(){
  int n;
  cin >> n;
  
  int a[n+1];
  
  for(int i= 1;i<=n;i++){
    cin >> a[i];
    
    for(int j = 1;j<=a[i];j++){
      cin >> b[i][j].first >> b[i][j].second ;
      b[i][j].first--;
    }
  }
  
  for(int i = 0; i<(1<<n) ;i++){
    bool flag = true;
    for(int j = 1;j<=n;j++){
      if(i&(1<<j)){
        for(int k = 1;k<=a[j] ; k++){
          if(b[j][k].second != (i&(1<<b[j][k].first))flag = false;
             }
             }
             }
             if(flag) ans = max(ans, (int)__builtin_popcount(i));
             }
             
             cout << ans << endl;
             return 0;
             }
  
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:27:54: error: expected ';' before 'flag'
   27 |           if(b[j][k].second != (i&(1<<b[j][k].first))flag = false;
      |                                                      ^~~~
      |                                                      ;
a.cc:28:14: error: expected primary-expression before '}' token
   28 |              }
      |              ^
a.cc:27:67: error: expected ')' before '}' token
   27 |           if(b[j][k].second != (i&(1<<b[j][k].first))flag = false;
      |             ~                                                     ^
      |                                                                   )
   28 |              }
      |              ~                                                     
a.cc:28:14: error: expected primary-expression before '}' token
   28 |              }
      |              ^
a.cc:31:23: error: 'ans' was not declared in this scope; did you mean 'abs'?
   31 |              if(flag) ans = max(ans, (int)__builtin_popcount(i));
      |                       ^~~
      |                       abs
a.cc:34:22: error: 'ans' was not declared in this scope; did you mean 'abs'?
   34 |              cout << ans << endl;
      |                      ^~~
      |                      abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
int n,a[20],x[20][20],y[20][20],ans=0;
void check(int bits){
        int num=0;
        REP(i,n){
            if(bits>>i&1){
                num++;
                REP(j,a[j])if((bits>>x[i][j]&1)!=y[i][j])return;
            }
        }
        ans=max(ans,num);
}
void solve() 
{
    cin>>n;
    REP(i,n){
        cin>>a[i];
        REP(j,a[i]){
            cin>>x[i][j]>>y[i][j] ;
            x[i][j]--;
        }
    }
    REP(bits,1<<n)check(bits);
    cout<<ans<<endl;
}
int main()
{
    cin.tie(0);
	ios::sync_with_stdio(false);
    solve();
    return 0;
}


Compiler output:
a.cc: In function 'void check(int)':
a.cc:6:13: error: 'i' was not declared in this scope
    6 |         REP(i,n){
      |             ^
a.cc:6:9: error: 'REP' was not declared in this scope
    6 |         REP(i,n){
      |         ^~~
a.cc: In function 'void solve()':
a.cc:17:9: error: 'i' was not declared in this scope
   17 |     REP(i,n){
      |         ^
a.cc:17:5: error: 'REP' was not declared in this scope
   17 |     REP(i,n){
      |     ^~~
a.cc:24:9: error: 'bits' was not declared in this scope
   24 |     REP(bits,1<<n)check(bits);
      |         ^~~~
Language: C++

#include <string>
#include <vector>
#include <cstring>
#include <algorithm>
#include <iostream> 
 
using namespace std;
typedef long long ll;
typedef long double ld;

//repetition
#define REP(i,n)  for(ll i=0;i<n;i++)

unsigned GetDigit(unsigned num){
    unsigned digit=0;
    while(num!=0){
        num /= 10;
        digit++;
    }
    return digit;
}
 
unsigned binarySearch(ll target, ll max, ll min) {
  while((max - min) > 1) {
      if((max + min)/2 > target) {
        max = (max + min)/2;
        min = min;
      } else {
        max = max;
        min = (max + min)/2;
      }
    }
}

ll n;

bool valid(ll bit, vector<pair<ll, pair<ll, ll>>> vp) {
  REP(i, vp.size()){
    
    cout << "bit: " << bit << endl;
    cout << "vp.at(i).first: " << vp.at(i).first << endl;
    cout << "n -1 -vp.at(i).first: " << n -1 -vp.at(i).first << endl;
    cout << "bit & (1 << n -1 -vp.at(i).first): " << (bit & (1 << n -1 -vp.at(i).first)) << endl;
    
    // 発言者が正直
    if(bit & (1 << n -1 -vp.at(i).first)) {
      // 発言内容と実際の値が異なる場合は不適
      if(bit & (1 << n - vp.at(i).second.first) != vp.at(i).second.second) return false;
    }
  }
  return true;
}
 

int main() {
  cin >> n;
  
  vector<vector<ll>> vp(n, vector<ll>(n, -1));
  
  REP(m, n) { //全ての集合
    ll r;
    cin >> r;
    
    REP(l, r) {
      ll p,q;
      cin >> p >> q;
      vp.at(m).at(p-1) = q;
    }
  }
  
  ll m = 0;
  
  REP(i, (1<<n)) {
    ll tmp = 0;

    bool isValid = true;
    
    //cout << "集合i: " << i << endl;

    REP(l, n) {
      if (1 & (i >> l)) {
        //cout << "正直者であるl人目: " << l+1 << endl;
        REP(x, n){
          //cout << "x人目に対する発言: " << x+1 << "xはvp.at(l).at(x): " << vp.at(l).at(x) << endl;

          if(vp.at(l).at(x) != -1 && (i >> l & 1) != vp.at(l).at(x)) {
            isValid = false;
          }
        }
        tmp++;
      }
    }
    if (isValid) {
d      m = max(m, tmp);
    }
  }
  cout << m << endl;
  
}


Compiler output:
a.cc: In function 'unsigned int binarySearch(ll, ll, ll)':
a.cc:33:1: warning: no return statement in function returning non-void [-Wreturn-type]
   33 | }
      | ^
a.cc: In function 'int main()':
a.cc:94:1: error: 'd' was not declared in this scope
   94 | d      m = max(m, tmp);
      | ^
Language: C++

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

int N, A[16], x[16][16], y[16][16];

int cnt(long long int k) {

	int ret = 0;
	while (k > 0) {
		if (k % 2 == 1) { ret++; }
		k /= 2;
	}
	return ret;
}

int IsPossible(int k) {

	int h[16];
	int tmp = k;
	for (int i = 1; i <= N; i++) {
		int y= tmp % 2;
		h[i] = y;
		tmp /= 2;
	}

	for (int i = 1; i <= N; i++) {
		if (h[i] == 0) {continue;}

		for (int j = 1; j <= A[i]; j++) {
			if (y[i][j] == 1 && h[x[i][j]] == 0) { return -1; }
			if (y[i][j] == 0 && h[x[i][j]] == 1) { return -1; }
		}

	}

	return 1;
}

int main(void) {

	cin >> N;

	for (int i = 1; i <= N; i++) {
		cin >> A[i];
		for (int j = 1; j <= A[i]; j++) {
			cin >> x[i][j] >> y[i][j];
		}
	}

	int ans = 0;

	for (int k = 0; k < pow(2, N); k++) {
	//	cout << bitset<8>(k) << "  "<<IsPossible(k)<<" " <<cnt(k)<<endl;
		if (IsPossible(k) == 1) { ans = max(ans, cnt(k)); }
	}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:54:29: error: 'pow' was not declared in this scope
   54 |         for (int k = 0; k < pow(2, N); k++) {
      |                             ^~~
Language: C++

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

int main(){
  int n;
  cin>>n;
  vector<int>a(n);
  vector<pair<int,int>>temh;
  vector<vector<pair<int,int>>>h{3};
  for(int i=0;i<n;i++){
      cin>>a[i];
      temh.clear();
      for(int j=0;j<a[i];j++){
          int x;int y;
          cin>>x>>y;
          temh.push_back(make_pair(x,y));
      }
      h.push_back(temh);
  }
  
  for(int bit=0; bit<pow(2,n); bit++){
      int cnt=0;
      bool can = false;
      for(int j = 0; j < n ; j++){
          if(bit&(1<<j)){
              for(int i=0;i<n;i++){
                  if(h[i][j].second == 3){
                      continue;
                  }
                  else if(h[i][j].second == 1){
                      can=true;cnt++;
                }else{
                    can=false;break;
              }
          }else{
              for(int i =0;i<n;i++){
                  if(h[i][j].second == 3)continue;
                  else if(h[i][j].second == 0)can=true;
                  else can=false;break;
              }
      if(can)cout<<cnt<<endl;return 0;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:12: error: expected '}' before 'else'
   36 |           }else{
      |            ^~~~
a.cc:26:25: note: to match this '{'
   26 |           if(bit&(1<<j)){
      |                         ^
a.cc:44:2: error: expected '}' at end of input
   44 | }
      |  ^
a.cc:22:38: note: to match this '{'
   22 |   for(int bit=0; bit<pow(2,n); bit++){
      |                                      ^
a.cc:44:2: error: expected '}' at end of input
   44 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

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

int main(){
  int n;
  cin>>n;
  vector<int>a(n);
  vector<pair<int,int>>temh;
  vector<vector<pair<int,int>>>h{3};
  for(int i=0;i<n;i++){
      cin>>a[i];
      temh.clear();
      for(int j=0;j<a[i];j++){
          int x;int y;
          cin>>x>>y;
          temh.push_back(make_pair(x,y));
      }
      h.push_back(temh);
  }
  
  for(int bit=0; bit<pow(2,n); bit++){
      int cnt=0;
      bool can = false;
      for(int j = 0; j < n ; j++){
          if(bit&(1<<j)){
              for(int i=0;i<n;i++){
                  if(h[i][j].second == 3)continue;
                  else if(h[i][j].second == 1)can=true;cnt++;
                  else can=false;break;
              }
          }else{
              for(int i =0;i<n;i++){
                  if(h[i][j].second == 3)continue;
                  else if(h[i][j].second == 0)can=true;
                  else can=false;break;
              }
          }
      }
      if(can)cout<<cnt<<endl;return 0;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:19: error: 'else' without a previous 'if'
   30 |                   else can=false;break;
      |                   ^~~~
Language: C++

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

int main(){
  int n;
  cin>>n;
  vector<int>a(n);
  vector<pair<int,int>>temh;
  vector<vector<pair<int,int>>>h{3};
  for(int i=0;i<n;i++){
      cin>>a[i];
      temh.clear();
      for(int j=0;j<a[i];j++){
          int x;int y;
          cin>>x>>y;
          temh.push_back(make_pair(x,y));
      }
      h.push_back(temh)
  }
  
  for(int bit=0; bit<pow(2,n); bit++){
      int cnt=0;
      bool can = false;
      for(int j = 0; j < n ; j++){
          if(bit&(1<<j)){
              for(int i=0;i<n;i++){
                  if(h[i][j].second == 3)continue;
                  else if(h[i][j].second == 1)can=true;cnt++;
                  else can=false;break;
              }
          }else{
              for(int i =0;i<n;i++){
                  if(h[i][j].second == 3)continue;
                  else if(h[i][j].second == 0)can=true;
                  else can=false;break;
              }
          }
      }
      if(can)cout<<cnt<<endl;return 0;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:24: error: expected ';' before '}' token
   19 |       h.push_back(temh)
      |                        ^
      |                        ;
   20 |   }
      |   ~                     
a.cc:30:19: error: 'else' without a previous 'if'
   30 |                   else can=false;break;
      |                   ^~~~
Language: C++

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

int main(){
  int n;
  cin>>n;
  vector<int>a(n);
  vector<pair<int,int>>temh;
  vector<vector<pair<int,int>>>h{3};
  for(int i=0;i<n;i++){
      cin>>a[i];
      temh.clear();
      for(int j=0;j<a[i];j++){
          int x;int y;
          cin>>x>>y;
          temh.push_back(make_pair(x,y));
      }
      h.push_back(temh)
  }
  
  for(int bit=0; bit<pow(2,n); bit++){
      int cnt=0;
      bool can = false;
      for(int j = 0; j < n ; j++){
          if(bit&(1<<j)){
              for(int i=0;i<n;i++){
                  if(h[i][j].second == 3)continue;
                  if(h[i][j].second == 1)can=true;cnt++;
                  else can=false;break;
              }
          }else{
              for(int i =0;i<n;i++){
                  if(h[i][j].second == 3)continue;
                  if(h[i][j].second == 0)can=true;
                  else can=false;break;
              }
          }
      }
      if(can)cout<<cnt<<endl;return 0;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:24: error: expected ';' before '}' token
   19 |       h.push_back(temh)
      |                        ^
      |                        ;
   20 |   }
      |   ~                     
a.cc:30:19: error: 'else' without a previous 'if'
   30 |                   else can=false;break;
      |                   ^~~~
Language: C++

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

int main(){
  int n;
  cin>>n;
  vector<int>a(n);
  vector<pair<int,int>>temh;
  vector<vector<pair<int,int>>>h={3};
  for(int i=0;i<n;i++){
      cin>>a[i];
      temh.clear();
      for(int j=0;j<a[i];j++){
          int x;int y;
          cin>>x>>y;
          temh.push_back(make_pair(x,y));
      }
      h.push_back(temh)
  }
  
  for(int bit=0; bit<pow(2,n); bit++){
      int cnt=0;
      bool can = false;
      for(int j = 0; j < n ; j++){
          if(bit&(1<<j)){
              for(int i=0;i<n;i++){
                  if(h[i][j].second == 3)continue;
                  if(h[i][j].second == 1)can[j]=true;cnt++;
                  else can[j]=false;break;
              }
          }else{
              for(int i =0;i<n;i++){
                  if(h[i][j].second == 3)continue;
                  if(h[i][j].second == 0)can=true;
                  else can[j]=false;break;
              }
          }
      }
      if(can)cout<<cnt<<endl;return 0;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:36: error: converting to 'std::vector<std::vector<std::pair<int, int> > >' from initializer list would use explicit constructor 'std::vector<_Tp, _Alloc>::vector(size_type, const allocator_type&) [with _Tp = std::vector<std::pair<int, int> >; _Alloc = std::allocator<std::vector<std::pair<int, int> > >; size_type = long unsigned int; allocator_type = std::allocator<std::vector<std::pair<int, int> > >]'
   10 |   vector<vector<pair<int,int>>>h={3};
      |                                    ^
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:556:7: note: 'std::vector<_Tp, _Alloc>::vector(size_type, const allocator_type&) [with _Tp = std::vector<std::pair<int, int> >; _Alloc = std::allocator<std::vector<std::pair<int, int> > >; size_type = long unsigned int; allocator_type = std::allocator<std::vector<std::pair<int, int> > >]' declared here
  556 |       vector(size_type __n, const allocator_type& __a = allocator_type())
      |       ^~~~~~
a.cc:19:24: error: expected ';' before '}' token
   19 |       h.push_back(temh)
      |                        ^
      |                        ;
   20 |   }
      |   ~                     
a.cc:29:45: error: invalid types 'bool[int]' for array subscript
   29 |                   if(h[i][j].second == 1)can[j]=true;cnt++;
      |                                             ^
a.cc:30:19: error: 'else' without a previous 'if'
   30 |                   else can[j]=false;break;
      |                   ^~~~
a.cc:30:27: error: invalid types 'bool[int]' for array subscript
   30 |                   else can[j]=false;break;
      |                           ^
a.cc:36:27: error: invalid types 'bool[int]' for array subscript
   36 |                   else can[j]=false;break;
      |                           ^
Language: C++

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

int main(){
  int n;
  cin>>n;
  vector<int>a(n);
  vector<pair<int,int>>temh;
  vector<vecor<pair<int,int>>>h={3};
  for(int i=0;i<n;i++){
      cin>>a[i];
      temh.clear();
      for(int j=0;j<a[i];j++){
          int x;int y;
          cin>>x>>y;
          temh.push_back(make_pair(x,y));
      }
      h.push_back(temh)
  }
  
  for(int bit=0; bit<pow(2,n); bit++){
      int cnt=0;
      bool can = false;
      for(int j = 0; j < n ; j++){
          if(bit&(1<<j)){
              for(int i=0;i<n;i++){
                  if(h[i][j].second == 3)continue;
                  if(h[i][j].second == 1)can[j]=true;cnt++;
                  else can[j]=false;break;
              }
          }else{
              for(int i =0;i<n;i++){
                  if(h[i][j].second == 3)continue;
                  if(h[i][j].second == 0)can=true;
                  else can[j]=false;break;
              }
          }
      }
      if(can)cout<<cnt<<endl;return 0;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'vecor' was not declared in this scope
   10 |   vector<vecor<pair<int,int>>>h={3};
      |          ^~~~~
a.cc:10:28: error: template argument 1 is invalid
   10 |   vector<vecor<pair<int,int>>>h={3};
      |                            ^~
a.cc:10:28: error: template argument 2 is invalid
a.cc:10:30: error: expected unqualified-id before '>' token
   10 |   vector<vecor<pair<int,int>>>h={3};
      |                              ^
a.cc:19:7: error: 'h' was not declared in this scope
   19 |       h.push_back(temh)
      |       ^
a.cc:28:22: error: 'h' was not declared in this scope
   28 |                   if(h[i][j].second == 3)continue;
      |                      ^
a.cc:29:22: error: 'h' was not declared in this scope
   29 |                   if(h[i][j].second == 1)can[j]=true;cnt++;
      |                      ^
a.cc:29:45: error: invalid types 'bool[int]' for array subscript
   29 |                   if(h[i][j].second == 1)can[j]=true;cnt++;
      |                                             ^
a.cc:30:19: error: 'else' without a previous 'if'
   30 |                   else can[j]=false;break;
      |                   ^~~~
a.cc:30:27: error: invalid types 'bool[int]' for array subscript
   30 |                   else can[j]=false;break;
      |                           ^
a.cc:34:22: error: 'h' was not declared in this scope
   34 |                   if(h[i][j].second == 3)continue;
      |                      ^
a.cc:35:22: error: 'h' was not declared in this scope
   35 |                   if(h[i][j].second == 0)can=true;
      |                      ^
a.cc:36:27: error: invalid types 'bool[int]' for array subscript
   36 |                   else can[j]=false;break;
      |                           ^
Language: C++

#include<iostream>
using namespace std;

int main(){
    cin >> N;
    int A[20];
    int x[20][20];
    int y[20][20];
    int count;
 for(int i=0;i<N;i++){
        cin >> A[i];
    for(int j=0;j<A[i];j++){
        
        cin >> x[i][j] >> y[i][j];
    }
        
    }

    for(int bit = 0;bit < (1<<N);++bit){
        for(int i=0;i<N;i++){
        if(bit & (1<<i)){
            count++;
        }
    }
    }
    cout << count;


return 0;


}

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

#include<iostream>
using namespace std;

int main(){
    cin >> N;
    int A[20];
    int x[20][20];
    int y[20][20];
    int count;
 for(int i=0;i<N;i++){
        cin >> A[i];
    for(int j=0;j<A[i];j++){
        
        cin >> x[i][j] >> y[i][j];
    }
        
    }

    for(int bit = 0;bit < (1<<N);++bit){
        for(int i=0;i<N;i++){
        if(bit & (1<<i)){
            count++;
        }
    }

    cout << count;


return 0;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:12: error: 'N' was not declared in this scope
    5 |     cin >> N;
      |            ^
a.cc:32:2: error: expected '}' at end of input
   32 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int n;
  int count=0;
  cin>>n;
  int n1=n;
  while(n--)
  {
    cin>>x;
    while(x--)
    {
      int arr[2];
      cin>>arr[0]>>arr[1];
      if(arr[1]==1)
      count++;
    }
  }
  if(count<n1)
    cout<<count<<endl;
  else
    cout<<"0";
}
  


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

#include<iostream>
using namespace std;
int main()
{
  int n,x;
  cin>>n;
  int n1=n;
  while(n--)
  {
    int count=0;
    cin>>x;
    while(x--)
    {
      int arr[2];
      cin>>arr[0]>>arr[1];
      if(arr[1]==1)
      count++;
    }
  }
  if(count<n1)
    cout<<count<<endl;
  else
    cout<<"0";
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:20:6: error: 'count' was not declared in this scope
   20 |   if(count<n1)
      |      ^~~~~
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int n1=n;
  while(n--)
  {
    int count=0;
    cin>>x;
    while(x--)
    {
      int arr[2];
      cin>>arr[0]>>arr[1];
      if(arr[1]==1)
      count++;
    }
  }
  if(count<n1)
    cout<<count<<endl;
  else
    cout<<"0";
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: 'x' was not declared in this scope
   11 |     cin>>x;
      |          ^
a.cc:20:6: error: 'count' was not declared in this scope
   20 |   if(count<n1)
      |      ^~~~~
Language: C++

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

using namespace std;

bool setValue(std::vector<std::vector<std::pair<int, int>>>& test,
	std::vector<int>& persons, int idx) {
	for (int i = 0; i < test[idx].size(); i++) {
		auto pr = test[idx][i];
		int val = persons[idx] == 1 ? (pr.second) : (1 - pr.second);
		if (persons[pr.first] == -1)
			persons[pr.first] = val;
		else {
			if (persons[pr.first] != val)
				return false;
		}
	}
	return true;
}

bool check(std::vector<std::vector<std::pair<int, int>>>& test, 
	std::vector<int> persons, int idx, int& nResult){
	if (idx >= persons.size()){
        int cnt = std::accumulate(persons.begin(), persons.end(), 0);
		nResult = max(nResult, cnt);
		return true;
	}
	if (persons[idx] == -1) {
		std::vector<int> _persons = persons;
		bool bRtn = false;
      	for (int k = 1; k >= 0; k--) {
			_persons[idx] = k;
			if (setValue(test, _persons, idx)) {
				if (check(test, _persons, idx + 1, result)) {	
                  	bRtn = true;
				}
			}
		}
      	return bRtn;
	} else {
		if (setValue(test, persons, idx)) {
			if (check(test, persons, idx + 1, result)) {
				return true;
			}
		}
	}
	return false;
}

int main() {
	int N;
	std::cin >> N;

	std::vector<std::vector<std::pair<int, int>>> test(N);

	for (int i = 0; i<N; i++) {
		int c;
		std::cin >> c;
		test[i].resize(c);
		for (int j = 0; j<c; j++) {
			int a, b;
			std::cin >> a >> b;
			test[i][j] = std::pair<int, int>(a - 1, b);
		}
	}

	std::vector<int> persons(N, -1);
  	int nResult = -1;
	bool bRtn = check(test, persons, 0, nResult);

	std::cout << cnt;

	return 0;
}

Compiler output:
a.cc: In function 'bool check(std::vector<std::vector<std::pair<int, int> > >&, std::vector<int>, int, int&)':
a.cc:39:68: error: 'result' was not declared in this scope; did you mean 'nResult'?
   39 |                                 if (check(test, _persons, idx + 1, result)) {
      |                                                                    ^~~~~~
      |                                                                    nResult
a.cc:47:59: error: 'result' was not declared in this scope; did you mean 'nResult'?
   47 |                         if (check(test, persons, idx + 1, result)) {
      |                                                           ^~~~~~
      |                                                           nResult
a.cc: In function 'int main()':
a.cc:76:22: error: 'cnt' was not declared in this scope; did you mean 'int'?
   76 |         std::cout << cnt;
      |                      ^~~
      |                      int
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cstring>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <bitset>
#include <stack>
#include <cmath>
#include <time.h>
#include <unordered_set>
#include <unordered_map>
#define ll long long
#define LINF 0x3f3f3f3f3f3f3f3f
#define INF 0x3f3f3f3f
#define PI 3.14159265
#define RAND (rand()*rand())
#define MAX(x, y) ((x) > (y) ? (x):(y))
#define MIN(x, y) ((x) > (y) ? (y):(x))
#define ABS(x) ((x) > 0 ? (x) : -(x))
#define CEIL(x, y) (((x) + (y) - 1)/(y))
using namespace std;

const int N = 1e6+10 ;
const ll MOD = 1e9 + 7;
typedef pair<ll,ll >PII;

vector<int >g[N];

int T,n,b,c,r;
int x1,x2,ans;
int a[N],p,k;

int dp[N];

int main(){
    int a[20][20],b[20][20];
    int num[20];
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>num[i];
        for(int j=0;j<num[i];j++){
            cin>>a[i][j]>>b[i][j];
        }
    }
    int ans = 0;
    for(int i=0;i<(1<<n);i++){
        bool f= true;
        for(int j=0;j<n;j++){
            if(i&(1<<j)){
                for(int k=0;j<num[k];k++){
                    if(((i>>(a[j][k]-1))&1) !=y[j][k]){
                        f= false;
                        break;
                    }
                }
            }
            if(!f) break;
        }
        if(f){
            bitset<16>bt(i);
            ans = max(ans,(int)bt.count());
        }
    }

   cout<<ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:55:47: error: 'y' was not declared in this scope
   55 |                     if(((i>>(a[j][k]-1))&1) !=y[j][k]){
      |                                               ^
Language: C++

use std::io::*;
use std::str::FromStr;
use std::cmp::max;
 
#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char) 
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}


fn main(){
    let N: u32 =read();
    let mut a=vec![];
    let mut g=vec![vec![];n];
    for i in 0..N{
        a.push(read(););
        for _ in 0..a[i] {
            let x = scan.read::<usize>()-1;
            let y = scan.read::<usize>();
            g[i].push((x, y));
        }

    }
    let mut ret = 0;
    'outer: for mask in 0..1<<n {
        for i in 0..n {
            if (mask >> i) & 1 == 1 {
                for &(v, k) in &g[i] {
                    if (mask >> v) & 1 != k {
                        continue 'outer;
                    }
                }
            }
        }
        ret = max(ret, (mask as u64).count_ones());
    }
    println!("{}", ret);
}

Compiler output:
a.cc:5:2: error: invalid preprocessing directive #[
    5 | #[allow(dead_code)]
      |  ^
a.cc:23:14: error: too many decimal points in number
   23 |     for i in 0..N{
      |              ^~~~
a.cc:25:18: error: too many decimal points in number
   25 |         for _ in 0..a[i] {
      |                  ^~~~
a.cc:33:5: warning: missing terminating ' character
   33 |     'outer: for mask in 0..1<<n {
      |     ^
a.cc:33:5: error: missing terminating ' character
   33 |     'outer: for mask in 0..1<<n {
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:34:18: error: too many decimal points in number
   34 |         for i in 0..n {
      |                  ^~~~
a.cc:38:34: warning: missing terminating ' character
   38 |                         continue 'outer;
      |                                  ^
a.cc:38:34: error: missing terminating ' character
   38 |                         continue 'outer;
      |                                  ^~~~~~~
a.cc:1:1: error: 'use' does not name a type
    1 | use std::io::*;
      | ^~~
a.cc:2:1: error: 'use' does not name a type
    2 | use std::str::FromStr;
      | ^~~
a.cc:3:1: error: 'use' does not name a type
    3 | use std::cmp::max;
      | ^~~
a.cc:6:1: error: 'fn' does not name a type
    6 | fn read<T: FromStr>() -> T {
      | ^~
a.cc:19:1: error: 'fn' does not name a type
   19 | fn main(){
      | ^~
a.cc:45:5: error: 'println' does not name a type
   45 |     println!("{}", ret);
      |     ^~~~~~~
a.cc:46:1: error: expected declaration before '}' token
   46 | }
      | ^
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = in.nextInt();
		
		ArrayList<int[]> t = new ArrayList[n];
		for (int i = 0; i < n; i++)
			t[i] = new ArrayList<>();

		for (int i = 0; i < n; i++)
			for (int j = 0; j < a[i]; j++) {
				int x = in.nextInt() - 1;
				int y = in.nextInt();
				t[i].add(new int[]{x, y});
			}

		int max = 0;
		for (int i = 0; i < (1 << n); i++) {
			boolean valid = true;
			for (int j = 0; j < n; j++) {
				boolean p = ((1 << j) & i) > 0;
				for (int[] tt : t[j]) {
					boolean x = ((1 << tt[0]) & i) > 0;
					if (p && x && tt[1] == 0)
						valid = false;
					if (p && !x && tt[1] == 1)
						valid = false;
				}
			}
			if (valid)
				max = Math.max(max, Integer.bitCount(i));
		}

		System.out.println(max);
	}
}


Compiler output:
Main.java:11: error: incompatible types: ArrayList[] cannot be converted to ArrayList<int[]>
		ArrayList<int[]> t = new ArrayList[n];
		                     ^
Main.java:13: error: array required, but ArrayList<int[]> found
			t[i] = new ArrayList<>();
			 ^
Main.java:19: error: array required, but ArrayList<int[]> found
				t[i].add(new int[]{x, y});
				 ^
Main.java:27: error: array required, but ArrayList<int[]> found
				for (int[] tt : t[j]) {
				                 ^
4 errors
Language: C++

include <bits/stdc++.h>
#define pb push_back
#define ff first
#define ss second
#define assign(x,val) memset(x,val,sizeof(x))
#define all(x) (x).begin(), (x).end()
#define for0(i,n) for(ll i=0;i<n;++i)
#define for1(i,n) for(ll i=1;i<=n;++i)
#define ford(i,n) for(ll i=n;i>=1;--i)
#define forg(i,a,b) for(ll i=a;i<b;++i)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpi;
typedef pair<ll, ll> pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pll> vpl;
long long mod = 1000000007;
const long double PI = (long double)(3.1415926535897932384626433832795);
 
 
void solve(){
  int n;cin>>n;
  int arr[n] = {0};
  for0(i,n){
    int a;cin>>a;
    while(a--){
    	int x, y;cin>>x>>y;
     	if(y==0 && x!=i+1) arr[x-1] = 1;
    }
  }
  int cnt = 0;
  for0(i,n) cnt += 1 - arr[i];
  cout<<cnt<<endl;
}
 
int main(){
	ll t = 1;
	//cin>>t;
	for0(i, t){
		solve();
	}
	return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc:14:9: error: 'pair' does not name a type
   14 | typedef pair<int, int> pii;
      |         ^~~~
a.cc:15:9: error: 'vector' does not name a type
   15 | typedef vector<int> vi;
      |         ^~~~~~
a.cc:16:9: error: 'vector' does not name a type
   16 | typedef vector<vi> vvi;
      |         ^~~~~~
a.cc:17:9: error: 'vector' does not name a type
   17 | typedef vector<pii> vpi;
      |         ^~~~~~
a.cc:18:9: error: 'pair' does not name a type
   18 | typedef pair<ll, ll> pll;
      |         ^~~~
a.cc:19:9: error: 'vector' does not name a type
   19 | typedef vector<ll> vl;
      |         ^~~~~~
a.cc:20:9: error: 'vector' does not name a type
   20 | typedef vector<vl> vvl;
      |         ^~~~~~
a.cc:21:9: error: 'vector' does not name a type
   21 | typedef vector<pll> vpl;
      |         ^~~~~~
a.cc: In function 'void solve()':
a.cc:27:9: error: 'cin' was not declared in this scope
   27 |   int n;cin>>n;
      |         ^~~
a.cc:38:3: error: 'cout' was not declared in this scope
   38 |   cout<<cnt<<endl;
      |   ^~~~
a.cc:38:14: error: 'endl' was not declared in this scope
   38 |   cout<<cnt<<endl;
      |              ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <intrin.h>

#define fi first
#define se second
#define pb push_back

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int n, ans = 0;

    cin >> n;

    vector<vector<pair<int, int>>> a(n);

    for (int i = 0, val, x, y; i < n; i++) {
        cin >> val;

        while (val > 0) {
            cin >> x >> y;
            a[i].pb({x - 1, y});
            val--;
        }
    }

    for (int i = 0; i < (1 << n); i++) {
        bool good = true;

        for (int j = 0; j < n; j++)
            if ((i >> j) & 1)
                for (auto each : a[j])
                    good &= (((i >> each.fi) & 1) == each.se);

        if (good) ans = max(ans, int(__popcnt(i)));
    }

    cout << ans << "\n";

    return 0;
}


Compiler output:
a.cc:5:10: fatal error: intrin.h: No such file or directory
    5 | #include <intrin.h>
      |          ^~~~~~~~~~
compilation terminated.