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

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

int g[15][15];
int main () {
  int n;
  cin >> n;
  rep(i,n)rep(j,n) g[i][j] = -1;
  rep(i,n){
    int a;
    cin >> a;
    rep(j,a){
      int x, y;
      cin >> x >> y;
      x--;
      g[i][x] = y;
    }
  }
  int ans = 0;
  rep(i,1<<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;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:27: error: '_builtin_popcount' was not declared in this scope; did you mean '__builtin_popcount'?
   35 |     if(ok) ans = max(ans, _builtin_popcount(i));
      |                           ^~~~~~~~~~~~~~~~~
      |                           __builtin_popcount
Language: C++

vector<vector<int> > person(15,vector<int>(15));
int main(){
    int n;
    cin>>n;
    for(int i=0;i<15;i++){
        for(int j=0;j<15;j++){
            person[i][j]=-1;
        }
    }
    for(int i=0;i<n;i++){
        int b;
        cin>>b;
        for(int j=0;j<b;j++){
            int x,y;
            cin>>x>>y;
            x--;
            person[i][x]=y;
        }
    }

    int ans=0;
    for(int i=0;i<(1<<n);i++){
        vector<int> a(n);
        for(int j=0;j<n;j++){
            a[j]=1;
        }
        bool ok=true;
        for(int j=0;j<n;j++){
            if(a[j]){
                for(int k=0;k<n;k++){
                    if(person[j][k]==-1)continue;
                    if(person[j][k]!=a[k])ok=false;
                }
            }
        }
        if(ok) ans=max(ans,__builtin_popcount(i));
    }
    cout<<ans<<endl;
}

Compiler output:
a.cc:1:1: error: 'vector' does not name a type
    1 | vector<vector<int> > person(15,vector<int>(15));
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
    4 |     cin>>n;
      |     ^~~
a.cc:7:13: error: 'person' was not declared in this scope
    7 |             person[i][j]=-1;
      |             ^~~~~~
a.cc:17:13: error: 'person' was not declared in this scope
   17 |             person[i][x]=y;
      |             ^~~~~~
a.cc:23:9: error: 'vector' was not declared in this scope
   23 |         vector<int> a(n);
      |         ^~~~~~
a.cc:23:16: error: expected primary-expression before 'int'
   23 |         vector<int> a(n);
      |                ^~~
a.cc:25:13: error: 'a' was not declared in this scope
   25 |             a[j]=1;
      |             ^
a.cc:29:16: error: 'a' was not declared in this scope
   29 |             if(a[j]){
      |                ^
a.cc:31:24: error: 'person' was not declared in this scope
   31 |                     if(person[j][k]==-1)continue;
      |                        ^~~~~~
a.cc:32:24: error: 'person' was not declared in this scope
   32 |                     if(person[j][k]!=a[k])ok=false;
      |                        ^~~~~~
a.cc:36:20: error: 'max' was not declared in this scope
   36 |         if(ok) ans=max(ans,__builtin_popcount(i));
      |                    ^~~
a.cc:38:5: error: 'cout' was not declared in this scope
   38 |     cout<<ans<<endl;
      |     ^~~~
a.cc:38:16: error: 'endl' was not declared in this scope
   38 |     cout<<ans<<endl;
      |                ^~~~
Language: C++

/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
			　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <iostream>
#include <vector>
#include <array>
#include <queue>
#include <stack>
#include <map>
#include <string>
#include <climits>
#include <tuple>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cmath>
#include <algorithm>
#include <memory>
#include <iomanip>
#include <type_traits>

#ifdef _MSC_VER
#include <intrin.h>
#define __builtin_pop_count __popcnt
#endif
#define rep(i, n) for(Int (i) = 0; (i) < (n); ++(i))
#define all(n) std::begin(n), std::end(n)
#define rall(n) std::rbegin(n), std::rend(n)
#define debug(var) std::cout << #var << ": " << var << "\n"
using Int = int64_t;
constexpr Int INF = INT_MAX;
constexpr Int mod = 1e9 + 7;


void init() {
	std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
}

void calc() {

	Int N; std::cin >> N;
	std::vector<std::vector<std::pair<Int, Int>>> data(N);
	rep(i, N) {
		Int A; std::cin >> A;
		data[i].resize(A);
		rep(j, A) {
			Int x, y; std::cin >> x >> y; x--;
			data[i][j].first = x, data[i][j].second = y;
		}
	}

	Int ans = 0;

	for (Int bit = 1; bit < (1 << N); ++bit) {
		Int res = -1;
		bool flag = true;
		rep(i, N) {
			rep(j, data[i].size()) {
				if (bit & (1 << i)) {
					Int y = data[i][j].second, x = data[i][j].first;
					if (y == 1) {
						if (!(bit & (1 << x)))flag = false;//xが正直者なのに違ったらだめ
					}
					else {
						if (bit & (1 << y))flag = false;
					}
				}
			}
		}

		if (flag) {
			res = __builtin_pop_count(bit);
			ans = std::max(ans, res);
		}

	}

	std::cout << ans;

}


int main() {

	init();
	calc();

	return 0;
}

Compiler output:
a.cc: In function 'void calc()':
a.cc:82:31: error: '__builtin_pop_count' was not declared in this scope; did you mean '__builtin_popcount'?
   82 |                         res = __builtin_pop_count(bit);
      |                               ^~~~~~~~~~~~~~~~~~~
      |                               __builtin_popcount
Language: C++

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

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define ALL(v) (v.begin(),v.end())
#define COUT(x) cout<<(x)<<"\n"

using pint = pair<int,int>;

int main(){
    int n,t;
    cin >> n;
    vector<vector<pint>>v;
    v.assign(n, vector<pint>());
    REP(i,n){
        cin >> t;
        v[i].resize(t);
        REP(j,t){
            cin >> v[i][j].first >> v[i][j].second;
            --v[i][j].first;
        }
    }
    
    int max1 = 0;
    for(int bit=0;bit<(1<<n);bit++){
        vector<int> vec;
        vector<int> vec1;
        count = 0;
        for(int i=0;i<n;i++){
            if(bit&(1<<i)){
                vec.push_back(i);
                vec1.push_back(1);
            }
            else vec1.push_back(0);
        }
        bool flag = true;
        for(const int x:vec){
            for(int j=0;j<v[x].size();j++){
                if(v[x][j].second!=vec1[v[x][j].first]){
                    flag = false;
                    break;
                }
            }
        }
        if(flag)max1=max(max1,__builtin_popcount(bit));
    }
    COUT(max1);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:17: error: overloaded function with no contextual type information
   35 |         count = 0;
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int N;
  cin >> N;
  int ans = 0;
  vector<vector<int>> x(N);
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    for (int j = 0; j < a; j++) {
      int b,c;
      cin >> b >> c;
      x[i].push_back(b);
      x[i].push_back(c);
    }
  }
  for (int bit = 0; bit < (1 << N); bit++) {
    bool OK = true;
    for (int i = 0; i < N; i++) {
      if (bit & (1 << i)) {
        for (int j = 0; j < x[i].size(); j+=2) {
          if (bit & (1 << (x[i][j]) - 1) && x[i][j + 1] == 0) {
            OK = false;
          }
          else if (!(bit & (1 << (x[i][j]) - 1))) && x[i][j + 1] == 1) {
            OK = false;
          }
        }
      }
    }
    if (OK) {
      ans = max(ans,__builtin_popcount(bit));
    }
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:55: error: expected ';' before '[' token
   27 |           else if (!(bit & (1 << (x[i][j]) - 1))) && x[i][j + 1] == 1) {
      |                                                       ^
      |                                                       ;
a.cc:27:54: error: label 'x' used but not defined
   27 |           else if (!(bit & (1 << (x[i][j]) - 1))) && x[i][j + 1] == 1) {
      |                                                      ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int N;
  cin>>N;
  vector　<vector<int>> Q (N,vector<int>(N,0))
  for(int i=0; i<N; i++){
    cin>>A;
    for(int j=0; j<A; j++){
      int x,y;
      if(y==1) Q[i][x-1]=1;
        
        }
  }
  

Compiler output:
a.cc:6:3: error: extended character 　 is not valid in an identifier
    6 |   vector　<vector<int>> Q (N,vector<int>(N,0))
      |   ^
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector\U00003000' was not declared in this scope
    6 |   vector　<vector<int>> Q (N,vector<int>(N,0))
      |   ^~~~~~~~
a.cc:6:22: error: expected primary-expression before '>' token
    6 |   vector　<vector<int>> Q (N,vector<int>(N,0))
      |                      ^~
a.cc:6:25: error: 'Q' was not declared in this scope
    6 |   vector　<vector<int>> Q (N,vector<int>(N,0))
      |                         ^
a.cc:7:16: error: 'i' was not declared in this scope
    7 |   for(int i=0; i<N; i++){
      |                ^
a.cc:14:4: error: expected '}' at end of input
   14 |   }
      |    ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C

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

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

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

signed main()
{
  int n;
  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;
  // bits ビットが立っているところが人iが正しい証言をしていることを意味する
  for(int bits=1; bits<(1<<n); bits++){
    bool ok=true;
    // 最大15人の人iについてのループ
    for(int i=1; i<=n; i++){
      // ビットiが立っている時だけ処理する
      // 正しい証言をしていると仮定しているもの(=ビットが立っている)だけ確認すればよい
      // iが立っていないものは「不確か」であって、「不正確であること」では無い事に注意
      if(!(bits & (1<<(i-1)))) continue;
      // 各人iの証言についてのループ
      for(int j=1; j<=a[i]; j++){
        // 矛盾しないかを判定する
        // 0^1 (bits上は不親切と仮定したのに正直者であると証言してしまっている)
        // 1^0 (正直者と仮定したのに不親切と証言してしまっている)
        if(((bits>>x[i][j]-1)&1) ^ y[i][j]) {
          // bits上正しいと仮定した人iの証言が全て矛盾しなければここを通らず、
          // bitsの立っているビットの数が、正直者の数と同値になる
          ok = false;
          break;
        }
      }
    }
    if(ok) chmax(ans, counter(bits));
  }
  cout<<ans<<endl;
}

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

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

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

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

signed main()
{
  int n;
  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;
  // bits ビットが立っているところが人iが正しい証言をしていることを意味する
  for(int bits=0; bits<(1<<n); bits++){
    bool ok=true;
    // 最大15人の人iについてのループ
    for(int i=1; i<=n; i++){
      // ビットiが立っている時だけ処理する
      // 正しい証言をしていると仮定しているもの(=ビットが立っている)だけ確認すればよい
      // iが立っていないものは「不確か」であって、「不正確であること」では無い事に注意
      if(!(bits & (1<<(i-1)))) continue;
      // 各人iの証言についてのループ
      for(int j=1; j<=a[i]; j++){
        // 矛盾しないかを判定する
        // 0^1 (bits上は不親切と仮定したのに正直者であると証言してしまっている)
        // 1^0 (正直者と仮定したのに不親切と証言してしまっている)
        if(((bits>>x[i][j]-1)&1) ^ y[i][j]) {
          // bits上正しいと仮定した人iの証言が全て矛盾しなければここを通らず、
          // bitsの立っているビットの数が、正直者の数と同値になる
          ok = false;
          break;
        }
      }
    }
    if(ok) chmax(ans, counter(bits));
  }
  cout<<ans<<endl;
}

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

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
int main(){
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<int> a(n);
    vector<vector<int>> x(n),y(n);
    rep(i,n) {
        cin >> a[i];
        x[i] = vector<int>(a[i]);
        y[i] = vector<int>(a[i]);
        rep(j, a[i]) {
            cin >> x[i][j];
            cin >> y[i][j];
            x[i][j]--;
        }
    }
    int max_honest=0;
    rep(bits,1<<n){
        bool ok_flag = true;
        rep(i, n) {
            if((bits & (1<<i)) == false) continue;
            rep(j, a[i]) {
                if(y[i][j] != ((bits&(1<<x[i][j]))!=0) {
                    ok_flag = false;
                    //cout << i << y[i][j] << x[i][j] << " " << bitset<8>(bits)<<endl;
                }
            }
        }
        if(ok_flag) {chmax(max_honest, __builtin_popcount(bits));}
    }
    cout << max_honest << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:55: error: expected ')' before '{' token
   29 |                 if(y[i][j] != ((bits&(1<<x[i][j]))!=0) {
      |                   ~                                   ^~
      |                                                       )
a.cc:33:13: error: expected primary-expression before '}' token
   33 |             }
      |             ^
Language: C++

#include <bits/stdc++.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <algorithm>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define acc(v) accumulate(v.begin(), v.end(), 0)

using namespace std;
typedef long long ll;
const int INF = 1e9;
const ll LINF = 1e18;
const ll MOD = 1e9 + 7;

int t[20];
int main()
{
	int n;
	cin >> n;
	vector<vector<pair<int, int>>> A(n);
	rep(i,n){
		int a;
		cin >> a;
		A[i].resize(a);
		rep(k, a)
		{
			int c, b;
			cin >> c >> b;
			if(b==0)
				b = -1;
			A[i][k] = make_pair(c-1, b);
		}
	}
	int ans = 0;
	for (int i = 0; i < (1 << n); i++)
	{
		int tans = 0;
		int isTrue = true;
		for (int k = 0; k < n; k++)
		{
			int tf = (i & (1 << k)) ? 1: -1;
			if(t[k]!=0 && t[k] != tf){
				isTrue = false;
				break;
			}
			if (tf==-1)
				continue;
			t[k] = t[k] ? t[k] : 1;
			if(t[k]!=1){
				isTrue = false;
				break;
			}
			tans++;
			for(auto l : A[k])
			{
				int x = l.first;
				int y = l.second;
				if(t[x]==0){
					t[x] = y;
					continue;
				}
				if(t[x] != y){
					isTrue = false;
					break;
				}
			}
			if(!isTrue)
				break;
		}
		for (int k = 0; k < n; k++)
		{
			if(i & (1<<k)){
				if(t[k] !=  1)
					isTrue = false;
			else
			{
				if (t[k] != -1)
					isTrue = false;
			}
		}
		ans = isTrue ? max(ans, tans) : ans;
		rep(j, 20)
			t[j] = 0;
		}
	cout << ans << endl;
}


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

#include <bits/stdc++.h>
 
using namespace std;
 
int countOnbit(int x) {
    if (x == 0)
        return 0;
 
    return countOnbit(x >> 1) + (x & 1);
}
 
int main() {
    int N;
    cin >> N;
    vector<int> A(N + 1);
    vector<vector<int>> x(N + 1);  // 指定した番号
    vector<vector<int>> y(N + 1);  // 正直者であるか否か
 
    for (int i = 1; i <= N; i++) {
        cin >> A.at(i);
        for (int j = 1; j <= A.at(i); j++) {
          	int a, b; cin >> a >> b;
			x[i].push_back(a);
			y[i].push_bakck(b);
        }
    }
 
    // 考え方メモ
    // 正直者か不親切な人かのパターンをビットで全て表す
    // ある人kが正直者でかつ証言に矛盾がない時、のビットの1を数える
    // ある人kが正直者である -> 右から(k - 1)番目のビットが1である
    // 矛盾がない時 -> 指定した番号のビット桁の数字が、パターンと等しい時
 
    int maxCount = 0;
    for (int bits = 1; bits < (1 << N); bits++) {
        bool isOk = true;
        for (int i = 1; i <= N; i++) {                // 人
            if (bits & (1 << (i - 1))) {              // ある人kが正直者である
                for (int j = 1; j <= A.at(i); j++) {  // 証言
                    if (y.at(i).at(j) == 1) {
                        if (!((bits >> (x.at(i).at(j) - 1)) & 1)) isOk = false;
                    } else {
                        if ((bits >> (x.at(i).at(j) - 1)) & 1) isOk = false;
                    }
                }
            }
        }
        if (isOk) maxCount = max(maxCount, countOnbit(bits));
    }
 
    cout << maxCount << endl;
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:30: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'class std::vector<int>'} has no member named 'push_bakck'; did you mean 'push_back'?
   24 |                         y[i].push_bakck(b);
      |                              ^~~~~~~~~~
      |                              push_back
Language: C++

#include <vector>
#include <algorithm>
#include <string>
#include <numeric>
#include <cmath>
using namespace std;
int t[15][15];                                                                                                       int main(){
    int n;
    int ans=0;
    cin >> n;
    //ready for mentions
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            //if no mention, then -1
            t[i][j] = -1;
        }
    }
    //get mentions
    for(int i=0;i<n;i++){
        int Ai=0;
        cin >> Ai;
        for(int j=0;j<Ai;j++){
            int x,y;
            cin >> x >> y;
            //i represents who mentions
            //x represents who is mentioned (need to adjust for array number)
            t[i][x-1] = y;
        }
    }
    //test all patern of honest and unkind
    for(int i=1; i < (1 << n); i++){
        bool ok=true;
        //vector person is made for convenience in terms of implementation.
        //if person[i]=1 then he/she is assumed to be honest
        //if person[i]=0 then he/she is assumed to be unkind
        vector<int> person(n);
        for(int j=0; j<n;j++){
            if(1 && (i>>j)){
                //if person[i] is honest, put flug to person[i]
                person[j] = 1;
            }
        }
        //Check Integrity between assumption and mentions
        for(int j=0;j<n;j++){
            //ignore unkind person
            if(person[j]) continue;
            //for honest person, verify his/her mention
            for(int k=0; k < n; k++){
                // nothing menthioned
                if(t[j][k] == -1) continue;
                // It's not correct if assumption and mention differ.
                if(t[j][k] != person[k]) ok=false;
            }
        }
        // __builtin_popcount(i) means number of active bits of given value.
        if(ok) ans=max(ans,__builtin_popcount(i));
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'cin' was not declared in this scope
   10 |     cin >> n;
      |     ^~~
a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    5 | #include <cmath>
  +++ |+#include <iostream>
    6 | using namespace std;
a.cc:58:5: error: 'cout' was not declared in this scope
   58 |     cout << ans << endl;
      |     ^~~~
a.cc:58:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:58:20: error: 'endl' was not declared in this scope
   58 |     cout << ans << endl;
      |                    ^~~~
a.cc:6:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    5 | #include <cmath>
  +++ |+#include <ostream>
    6 | using namespace std;
Language: C++

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

int main(){
  
  vector<int> A(N);
  vector<vector<int>> x(N);
  vector<vector<int>> y(N);
  
}

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

def is_nth_bit_set(x, n):
    if x & (1 << n):
        return 1
    else:
        return 0


N = int(input())
comment = {}
for i in range(N):
    A = int(input())
    comment[i + 1] = []
    for _ in range(A):
        x, y = map(int, input().split())
        comment[i + 1].append((x, y))

ans = 0
for i in range(2 ** N):
    judge = [None] * N
    flag = True
    for j in range(N):
        honest = is_nth_bit_set(i, j)
        judge[j] = honest

    for j in range(N):
        honest = is_nth_bit_set(i, j)
        for x, y in comment[j + 1]:
            if honest:
                if judge[x - 1] == y:
                    continue
                else:
                    flag = False
                    break
            else:
                if judge[x - 1] == abs(y - 1):
                    continue
                else:
                    flag = False
                    break

        if not flag:
            break

    if not flag:
        continue

    tmp = sum(judge)
    if tmp > ans:
        ans = tmp
print(ans)


Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def is_nth_bit_set(x, n):
      | ^~~
a.cc:10:1: error: expected unqualified-id before 'for'
   10 | for i in range(N):
      | ^~~
Language: C++

package main

import (
	"bufio"
	"fmt"
	"os"
)

var (
	read  = bufio.NewReader(os.Stdin)
	write = bufio.NewWriter(os.Stdout)
)

func main() {
	defer write.Flush()

	var n int
	fmt.Fscan(read, &n)

	A := make([]int, n)
	B := make([]int, n)
	C := make([]int, n)
	for i := range A {
		fmt.Fscan(read, &A[i])
		b, c := 0, 0
		for j := 0; j < A[i]; j++ {
			var x, y int
			fmt.Fscan(read, &x, &y)
			if y == 1 {
				b |= 1 << (x - 1)
			} else {
				c |= 1 << (x - 1)
			}
		}
		B[i] = b
		C[i] = c
	}

	ans := 0
	for mask := 0; mask < (1 << n); mask++ {
		chk := true
		for i := 0; i < n; i++ {
			if (mask>>i)&1 == 0 {
				continue
			}
			if mask&B[i] != B[i] || mask&C[i] != 0 {
				chk = false
			}
		}
		if chk {
			cnt := 0
			tmp := mask
			for tmp > 0 {
				if tmp&1 == 1 {
					cnt++
				}
				tmp = tmp >> 1
			}
			if cnt > ans {
				ans = cnt
			}
		}
	}
	fmt.Fprintln(write, ans)
}


Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package main
      | ^~~~~~~
Language: C++

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

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int d[15][15];
  int n;
  cin >> n;
  rep(i,n)rep(j,n) d[i][j] = -1;
  rep(i,n) {
    int m;
    cin >> m;
    rep(i,m) {
      int x, y;
      cin >> x >> y;
      x--;
      d[i][x] = a;
    }
  }
  int ans = 0;
  rep(i,1<<n) {
    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) comtinue;
          if(g[j][k] != 0 ) ok = false;
        }
      }
    }
    if(ok) ans = max(ans, __builtin_popcount(1));
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: 'a' was not declared in this scope
   21 |       d[i][x] = a;
      |                 ^
a.cc:34:14: error: 'g' was not declared in this scope
   34 |           if(g[j][k] == -1) comtinue;
      |              ^
a.cc:34:29: error: 'comtinue' was not declared in this scope
   34 |           if(g[j][k] == -1) comtinue;
      |                             ^~~~~~~~
a.cc:35:14: error: 'g' was not declared in this scope
   35 |           if(g[j][k] != 0 ) ok = false;
      |              ^
Language: C++

// AtCoder140150c.cpp : Defines the entry point for the console application.
//

#include <iostream>
#include <vector>


//https://kenkoooo.com/atcoder/#/table/

using namespace std;

void func147c()
{
    int n;
    cin >> n;


    vector<vector<int>> a(n, vector<int>(n));
    //証言を-1で初期化
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < n; ++j) {
            a[i][j] = -1;
        }
    }

    for (int i = 0; i < n; ++i) {
        int temp;
        cin >> temp; //証言の数
        for (int j = 0; j < temp; ++j) {
            int x, y;
            cin >> x;
            cin >> y;
            a[i][x] = y;
        }
    }

    /*
    証言の組み合わせを全通り探索
    全員正直者から始め、成立しないなら正直者を減らしていく
    正直者・不親切な人は１と０で表せるので
    2進数11111・・・で始め、1ずつ減らしていけば全通り探索できるはず
    成立し次第その人数を出力して終わり
    */

    int bin = pow(2, n) - 1;
    vector<int> syogen(n);
    while (bin > 0) {
        //証言ベクター更新
        int temp = bin;
        for (int i = 0; i < n; ++i) {
            int temp2 = pow(2, n - 1 - i);
            if (temp / temp2 > 0) syogen[i] = 1;
            else syogen[i] = 0;
            temp %= temp2;
        }


        /*
        cout << bin << "\n";
        for (int i = 0; i < n; ++i) {
            cout << syogen[i] << " ";
        }
        cout << "\n\n";
        */

        //証言を調べる
        int judge = 1;
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < n; ++j) {
                int temp = a[i][j]; //証言を取り出す
                if (temp == -1) continue; //-1は証言なしとして飛ばす
                if (syogen[i] != temp) {//証言に食い違いが出たら間違いなのでbreak
                    judge = 0;
                    break;
                }
            }
            if (judge == 0) break;
        }

        if (judge == 1) break; //judge==1ならbreak
        --bin; //judge==0なら--bin、正直者の組み合わせを変えてもう一回
    }

    int ans = 0;
    for (int i = n; i > 0; --i) {
        int temp = pow(2, i - 1);
        if (bin / temp > 0) ++ans;
        bin %= temp;
    }

    cout << ans;


}



int main()
{
     
    func147c();
    return 0;
}



Compiler output:
a.cc: In function 'void func147c()':
a.cc:45:15: error: 'pow' was not declared in this scope
   45 |     int bin = pow(2, n) - 1;
      |               ^~~
Language: C++

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

int g[15][15];

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

}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: error: 'book' was not declared in this scope; did you mean 'bool'?
   27 |         book ok = true;
      |         ^~~~
      |         bool
a.cc:32:41: error: 'ok' was not declared in this scope; did you mean 'k'?
   32 |                     if(g[j][k] == d[k]) ok = false;
      |                                         ^~
      |                                         k
a.cc:36:12: error: 'ok' was not declared in this scope
   36 |         if(ok) ans = max(ans, __builtin_popcount(i));
      |            ^~
Language: C++


#include <bits/stdc++.h>
#include <math.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1001001001;
const int mINF = -1001001001;

int counter(int x){
  if(x==0) return 0;
  return counter(x>>1) + (x&1);
}
int main() {

int n;
cin >> n;
int a[20];
int x[20][20];
int y[20][20];
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;
bool ok = true;
for(int bits = 1;bits < (1<<n);bits++) {
  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 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:25: error: expected ')' before ';' token
   33 |   for(int i = 1;i<=n;i++;) {
      |      ~                  ^
      |                         )
a.cc:33:26: error: expected primary-expression before ')' token
   33 |   for(int i = 1;i<=n;i++;) {
      |                          ^
Language: Java

import java.util.ArrayList;
import java.util.Scanner;

public class C_147 {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			int N = scan.nextInt();
			int[]A = new int[N];
			
			ArrayList<ArrayList<Integer>>XA = new ArrayList<ArrayList<Integer>>();
			ArrayList<ArrayList<Integer>>YA = new ArrayList<ArrayList<Integer>>();
			
			
			/*for(int i = 1;i<=N;i++) {
				A[i-1] = scan.nextInt();
				ArrayList<Integer> xa = new ArrayList<Integer>();
				ArrayList<Integer> ya = new ArrayList<Integer>();
				for(int j = 1;j<=A[i-1];j++) {
					xa.add(scan.nextInt());
					ya.add(scan.nextInt());
				}
				
				XA.add(xa);
				YA.add(ya);
			}*/
			
			char [][] shougen = new char[(int)Math.pow(2,N)][N];//'0'or'1'
			
			
			
			
			for (int i=0; i<(Math.pow(2,N)); i++) {
				StringBuffer sb = new StringBuffer();
				
				for (int j=0; j<N; j++) {
					if ((1&i>>j) == 1) { sb.append("1");}
					if ((1&i>>j) == 0) { sb.append("0");}
				}
				shougen[i] =sb.toString().toCharArray();//N人が正直者か嘘かの組み合わせ
				
				//System.out.println(sb.toString());
			}
			
			
			for (int k=0; k<(Math.pow(2,N)); k++) {
				
			}
			
			for(int i = 1;i<=N;i++) {
				for(int j = 1;j<=A[i-1];j++) {
					XA.get(i).get(j);
				}
				
			}
			
			
			
			
			
			
			
			
			
		}
		
		
	}
		

}


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

from queue import Queue

N = int(input())

data = {}

for i in range(N):
  i = i + 1
  data[i] = {}
  for _ in range(int(input())):
    x, y = map(int, input().split())
    data[i][x] = y

count = 0
for i in data:
  queue = Queue()
  queue.put(i)
  true = set()
  true.add(i)
  contradictory = False
  while not queue.empty() and not contradictory:
    i = queue.get()
    for x, y in data[i].items():
      if y == 1 and x not in true:
        true.add(x)
        queue.put(x)
      if y == 0 and x in true:
        contradictory = True
        break

  if not contradictory:
    count = max(count, len(true))

print(count)


Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from queue import Queue
      | ^~~~
a.cc:7:1: error: expected unqualified-id before 'for'
    7 | for i in range(N):
      | ^~~
a.cc:10:3: error: expected unqualified-id before 'for'
   10 |   for _ in range(int(input())):
      |   ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  scanf("%d", &n);
  vector<vector<pair<int, int>>> a(n);
  for (int i = 0; i < n; ++i) {
    int k;
    scanf("%d", &k);
    a[i].resize(k);
    for (int j = 0; j < k; ++j) {
      scanf("%d %d", &a[i][j].first, &a[i][j].second);
      --a[i][j].first;
    }
  }
  int ans = 0;
  for (int mask = 0; mask < (1 << n); ++mask) {
    bool ok = true;
    for (int i = 0; i < n; ++i) {
      if (mask &&( 1<<i)) {
        for (int j = 0; j < int(a[i].size()); ++j) {
          ok &= (((mask >> a[i][j].first) & 1) == a[i][j].second);
        }
      }
    }
    if (ok) ans = max(ans, __builtin_popcount(mask));
  }
  printf("%d\n", ans);

Compiler output:
a.cc: In function 'int main()':
a.cc:29:23: error: expected '}' at end of input
   29 |   printf("%d\n", ans);
      |                       ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <cstdio>
#include<iostream>
#include<algorithm>

using namespace std ;
int main(){
int n ;
int a[15];
int x[15][15];
bool y[15][15];
int max=0;
cin >> n ;
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++){
bool flag=1;
 for(int i=0;i<n;i++){
  for(int j=0;j<a[i];j++){
if(bit&(1<<i) && y[i][j]!= (bool)(bit&(1<<x[i][j]-1)))flag=0;
  }
 }
if(flag)max= max(__builtin_popcount(bit),max);
}
cout << max << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: 'max' cannot be used as a function
   26 | if(flag)max= max(__builtin_popcount(bit),max);
      |              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <cstdio>
#include<iostream>

using namespace std ;
int main(){
int n ;
int a[15];
int x[15][15];
bool y[15][15];
int max=0;
cin >> n ;
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++){
bool flag=1;
 for(int i=0;i<n;i++){
  for(int j=0;j<a[i];j++){
　if(bit&(1<<i) && y[i][j]!= (bool)(bit&(1<<x[i][j]-1)))flag=0;
  }
 }
if(flag)max= max(__builtin_popcount(bit),max);
}
cout << max << endl;
return 0;
}

Compiler output:
a.cc:22:1: error: extended character 　 is not valid in an identifier
   22 | 　if(bit&(1<<i) && y[i][j]!= (bool)(bit&(1<<x[i][j]-1)))flag=0;
      | ^
a.cc: In function 'int main()':
a.cc:22:1: error: '\U00003000if' was not declared in this scope
   22 | 　if(bit&(1<<i) && y[i][j]!= (bool)(bit&(1<<x[i][j]-1)))flag=0;
      | ^~~~
a.cc:25:17: error: 'max' cannot be used as a function
   25 | if(flag)max= max(__builtin_popcount(bit),max);
      |              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <cstdio>
#include<iostream>

using namespace std ;
int main(){
int n ;
int a[15];
int x[15][15];
bool y[15][15];
int max=0;
cin >> n ;
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++){
bool flag=1;
 for(int i=0;i<n;i++){
  for(int j=0;j<a[i];j++){
　if(bit&(1<<i) && yij != (bool)(bit&(1<<xij-1)))flag=0;
  }
 }
if(flag)max= max(__builtin_popcount(bit),max);
}
cout << max << endl;
return 0;
}

Compiler output:
a.cc:22:1: error: extended character 　 is not valid in an identifier
   22 | 　if(bit&(1<<i) && yij != (bool)(bit&(1<<xij-1)))flag=0;
      | ^
a.cc: In function 'int main()':
a.cc:22:20: error: 'yij' was not declared in this scope
   22 | 　if(bit&(1<<i) && yij != (bool)(bit&(1<<xij-1)))flag=0;
      |                    ^~~
a.cc:22:42: error: 'xij' was not declared in this scope
   22 | 　if(bit&(1<<i) && yij != (bool)(bit&(1<<xij-1)))flag=0;
      |                                          ^~~
a.cc:22:1: error: '\U00003000if' was not declared in this scope
   22 | 　if(bit&(1<<i) && yij != (bool)(bit&(1<<xij-1)))flag=0;
      | ^~~~
a.cc:25:17: error: 'max' cannot be used as a function
   25 | if(flag)max= max(__builtin_popcount(bit),max);
      |              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

int main(){
  int N;
  cin>>N;
  vector<int> A(N);
  vector<vector<int>> x(N),y(N);
  for(int i=0;i<N;i++){
    cin>>A.at(i);
    for(int j=0;j<A.at(j)){
      int a,b;
      cin>>a>>b;
      x.at(i).push_back(a-1);
      y.at(i).push_back(b);
    }
  }
  
  int ans=0;
  
  for(int i=0;i<(1<<N);i++){
    vector<int> honest(N);
    bool flag=true;
    for(int j=0;j<N;j++){
      honest.at(j)=i%(1<<(j+1));
      if(honest.at(j)==0){
        continue;
      }
      for(int k=0;k<x.at(j).size();k++){
        if(y.at(j).at(k)!=honest.at(x.at(j).at(k))){
          flag=false;
          break;
        }
      }
      if(!flag){
        break;
      }
    }
    if(flag){
      int aa=0;
      for(int j=0;j<N;j++){
        aa+=honest.at(j);
      }
      ans=max(ans,aa);
    }
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:26: error: expected ';' before ')' token
   11 |     for(int j=0;j<A.at(j)){
      |                          ^
      |                          ;
Language: C++

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

int main(){
  int N;
  cin>>N;
  vector<int> A(N);
  vector<vector<int>> x(N),y(N);
  for(int i=0;i<N;i++){
    cin>>A.at(i);
    for(int j=0;j<A.at(j)){
      int a,b;
      cin>>a>>b;
      x.at(i).push_back(a-1);
      y.at(i).push_back(b);
    }
  }
  
  int ans=0;
  
  for(int i=0;i<(1<<N);i++){
    vector<int> honest(N);
    bool flag=true;
    for(int j=0;j<N;j++){
      honest.at(j)=i%(1<<(j+1));
      if(honest.at(j)==0){
        continue;
      }
      for(int k=0;k<x.at(j).size();k++){
        if(y.at(j).at(k)!=honest.at(x.at(j).at(k))){
          flag=false;
          break;
        }
      }
      if(!flag){
        break;
      }
    }
    if(flag){
      int A=0;
      for(int j=0;j<N;j++){
        A+=honest.at(j);
      }
      ans=max(ans,A);
    }
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:26: error: expected ';' before ')' token
   11 |     for(int j=0;j<A.at(j)){
      |                          ^
      |                          ;
Language: C++

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

int main(){
  int N;
  cin>>N;
  vector<int> A(N);
  vector<vector<int>> x(N),y(N);
  for(int i=0;i<N;i++){
    int a,b;
    cin>>a>>b;
    x.at(i).push_back(a-1);
    y.at(i).push_back(b);
  }
  
  int ans=0;
  
  for(int i=0;i<(1<<N);i++){
    vector<int> honest(N);
    bool flag=true;
    for(int j=0;j<N;j++){
      if(honest.at(j)==0){
        honest(j)=i%(1<<(j+1));
        continue;
      }
      for(int k=0;k<x.at(j).size();k++){
        if(y.at(j).at(k)!=honest.at(x.at(j).at(k))){
          flag=false;
          break;
        }
      }
      if(!flag){
        break;
      }
    }
    if(flag){
      int A=0;
      for(int j=0;j<N;j++){
        A+=honest.at(j);
      }
      ans=max(ans,A);
    }
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:15: error: no match for call to '(std::vector<int>) (int&)'
   23 |         honest(j)=i%(1<<(j+1));
      |         ~~~~~~^~~
Language: C++

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

int main(){
  int N;
  cin>>N;
  vector<int> A(N);
  vector<vector<int>> x(N),y(N);
  for(int i=0;i<N;i++){
    int a,b;
    cin>>a>>b;
    x.at(i).push_back(a-1);
    y.at(i).push_back(b);
  }
  
  int ans=0;
  vector<int> honest(N);
  honest.at(0)=2;
  for(int i=0;i<N-1;i++){
    honest.at(i+1)=honest.at(i)*2
  }
  
  for(int i=0;i<(1<<N);i++){
    bool flag=true;
    for(int j=0;j<N;j++){
      if(honest.at(j)==0){
        continue;
      }
      for(int k=0;k<x.at(j).size();k++){
        if(y.at(j).at(k)!=honest.at(x.at(j).at(k))){
          flag=false;
          break;
        }
      }
      if(!flag){
        break;
      }
    }
    if(flag){
      int A=0;
      for(int j=0;j<N;j++){
        A+=honest.at(j);
      }
      ans=max(ans,A);
    }
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:34: error: expected ';' before '}' token
   20 |     honest.at(i+1)=honest.at(i)*2
      |                                  ^
      |                                  ;
   21 |   }
      |   ~
Language: C++

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

int main(){
  int N;
  cin>>N;
  vector<int> A(N);
  vector<vector<int>> x(N),y(N);
  for(int i=0;i<N;i++){
    int a,b;
    cin>>a>>b;
    x.at(i).push_back(a-1);
    y.at(i).push_back(b);
  }
  
  int ans=0;
  int honest(N);
  honest.at(0)=2;
  for(int i=0;i<N-1;i++){
    honest.at(i+1)=honest.at(i)*2
  }
  
  for(int i=0;i<(1<<N);i++){
    bool flag=true;
    for(int j=0;j<N;j++){
      if(honest.at(j)==0){
        continue;
      }
      for(int k=0;k<x.at(j).size();k++){
        if(y.at(j).at(k)!=honest.at(x.at(j).at(k))){
          flag=false;
          break;
        }
      }
      if(!flag){
        break;
      }
    }
    if(flag){
      int A=0;
      for(int j=0;j<N;j++){
        A+=honest.at(j);
      }
      ans=max(ans,A);
    }
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:10: error: request for member 'at' in 'honest', which is of non-class type 'int'
   18 |   honest.at(0)=2;
      |          ^~
a.cc:20:12: error: request for member 'at' in 'honest', which is of non-class type 'int'
   20 |     honest.at(i+1)=honest.at(i)*2
      |            ^~
a.cc:20:27: error: request for member 'at' in 'honest', which is of non-class type 'int'
   20 |     honest.at(i+1)=honest.at(i)*2
      |                           ^~
a.cc:26:17: error: request for member 'at' in 'honest', which is of non-class type 'int'
   26 |       if(honest.at(j)==0){
      |                 ^~
a.cc:30:34: error: request for member 'at' in 'honest', which is of non-class type 'int'
   30 |         if(y.at(j).at(k)!=honest.at(x.at(j).at(k))){
      |                                  ^~
a.cc:42:19: error: request for member 'at' in 'honest', which is of non-class type 'int'
   42 |         A+=honest.at(j);
      |                   ^~
Language: C++

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

int main(){
  int N;
  cin >> N;
  vector<int> A(N);
  using vi = vector<int>;
  using vvi = vector<vi>;
  vvi vec(N, vi(2 * N));
  for(int i = 0; i < N; i++){
    cin >> A.at(i);
  	for (int j = 0; j < 2 * A.at(i); j++) {
      	cin >> vec.at(i).at(j);
  	}
  }
  int res = 0;
  for(int bit = 0; bit < (1 << N); bit++){
    bool outer = true;
    for(int i = 0; i < N; i++){
      	bool innerf = true;
    	if(bit & (1 << i)){
        	for(int j = 0; j < 2 * A.at(i); j += 2){
            	int x = vec.at(i).at(j);
              	int y = vec.at(i).at(j+1);
              	if(y){
                	if(!(bit & (1 << (x-1)))){
                    	innerf = false;
                      	break;
                    }
                }
              	else{
                	if(bit & (1 << (x-1))){
                    	innerf = false;
                      	break;
                    }
                }
            }        	
        }
      	if(!innerf){
          	outer = false;
        	break;
        }
    }
    if(outer){
    	res = max(res, _builtin_popcount(bit));
    }
  }
  cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:24: error: '_builtin_popcount' was not declared in this scope; did you mean '__builtin_popcount'?
   46 |         res = max(res, _builtin_popcount(bit));
      |                        ^~~~~~~~~~~~~~~~~
      |                        __builtin_popcount
Language: C++

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

//repetition
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

//container util
#define all(x) (x).begin(),(x).end()

//typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;

//const value
//const ll MOD = 1e9 + 7;
//const int dx[] = {0,1,0,-1};//{0,0,1,1,1,-1,-1,-1};
//const int dy[] = {1,0,-1,0};//{1,-1,0,1,-1,0,1,-1};

//conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
inline ll toLL(string s) {ll v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

template <typename T1, typename T2> 
inline bool chmax(T1 &a, T2 b) {
  return a < b && (a = b, true);
}

template <typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {
  return a > b && (a = b, true);
}

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  VLL a(n);
  VVI x(n), y(n);
  rep(i, n) {
    cin >> a[i];
    x[i].resize(a[i]);
    y[i].resize(a[i]);
    rep(j, a[i]) {
      cin >> x[i][j] >> y[i][j];
      x[i][j]--;
    }
  }
  ll ans = 0;
  rep(bit, 1 << n) {
    ll tmp = 0;
    rep(i, n) {
      if (((bit >> i) & 1) == 0) continue;
      tmp++;
      bool ok = true;
      rep(j, a[i]) {
        if (((bit >> y[i][j]) & 1) != x[i][j]) ok = false;
      }
    }
    if (ok) chmax(ans, tmp);
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:68:9: error: 'ok' was not declared in this scope
   68 |     if (ok) chmax(ans, tmp);
      |         ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,x,y,P=0;
  cin>>N;
  vector<int>A(N);
  vector<vector<pair<int,int>>>s(N,vector<pair<int,int>>(N));
  for(int i=0;i<N;i++){
    cin>>A.at(i);
    for(int j=0;j<A.at(i);j++){
      cin>>x>>y;
      s.at(i).at(j)=make_pair(x,y);
    }
  }
  for(int i=0;i<(1<<10);i++){
    bitset<16>x(i);
    if(x.test(N))break;
    for(int j=0;j<N;j++){
      if(x.test(j)){
        int k;
        for(k=0;k<A.at(j);k++)if(x[s.at(j).at(k).first]!=s.at(j).at(k).second)break;
        if(k!=A.at(j))break;
      }
      P=max(P,x.count());
    }
  }
  cout<<P<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:12: error: no matching function for call to 'max(int&, std::size_t)'
   24 |       P=max(P,x.count());
      |         ~~~^~~~~~~~~~~~~
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:24:12: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::size_t' {aka 'long unsigned int'})
   24 |       P=max(P,x.count());
      |         ~~~^~~~~~~~~~~~~
/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:24:12: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   24 |       P=max(P,x.count());
      |         ~~~^~~~~~~~~~~~~
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 g[15][15];
    int main(){
        int n;
        std::cin >> n;
        rep(i, n)rep(j, n) g[i][j] = -1;
        rep(i, n){
            int m;
            std::cin >> m;
            rep(j, m){
                int a, x;
                std::cin >> a >> x;
                --a;
                g[i][a] = x;
            }
        }
        int ans = 0;
        rep(i, 1 << n){
            std::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));        
        }
        std::cout << ans << "\n";
    
        
    
        return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:39:32: error: '_builtin_popcount' was not declared in this scope; did you mean '__builtin_popcount'?
   39 |         if (ok) ans = max(ans, _builtin_popcount(i));
      |                                ^~~~~~~~~~~~~~~~~
      |                                __builtin_popcount