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

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

using namespace std;

int N;
vector<vector<pair<int, bool>>> n;

int main(int argc, char const *argv[])
{
    cin >> N;
    n.resize(N);
    for (int i = 0; i < N; i++)
    {
        int an;
        cin >> an;
        vector<pair<int, bool>> a(an);
        for (int j = 0; j < an; j++)
        {
            int x, y;
            cin >> x >> y;
            a.at(j) = make_pair(x, y);
        }
        n.at(i) = a;
    }
    int m(0);
    for (int i = ((1 << N) - 1); i >= 0; --i)
    {
        int mm(0);
        bitset<15> b(i);
        for (int j = 0; j < N; j++)
        {
            if (b.test(j))
            {
                mm++;
                for (auto e : n.at(j))
                {
                    if (b.test(e.first - 1) == e.second)
                    {
                    }
                    else
                    {
                        goto no;
                    }
                }
            }
            else
            {
                for (auto e : n.at(j))
                {
                    if (b.test(e.first - 1) == !e.second)
                    {
                    }
                    else
                    {
                        goto no;
                    }
                }
            }
        }
        m = max(m, mm);
    no:
        continue;
    }
    cout << m << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:32:9: error: 'bitset' was not declared in this scope
   32 |         bitset<15> b(i);
      |         ^~~~~~
a.cc:5:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
    4 | #include <vector>
  +++ |+#include <bitset>
    5 | 
a.cc:32:20: error: 'b' was not declared in this scope
   32 |         bitset<15> b(i);
      |                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
vector<int> visited;
vector<vector<int> > vec;
int dfs(int x){
  visited[x]=true;
  int cnt = 0;
  for(int i = 0; i < vec[x].size(); ++i){
    if(!visited[vec[x][i]]){
      cnt = dfs(vec[x][i]) + 1;
    }
  }
  return cnt;
}

int main(){
  int n, a;
  cin>>n;
  vec.resize(n);
  for(int j = 0; j < n; ++j){
    cin>>a;
    for(int i = 0; i < a; ++i){
      cin>>x>>y;
      x--;
      if(y)vec[x].push_back(i);
      else vec[i].push_back(x);
    }
  }
  for(int i = 0; i < n; ++i){
    visited.clear();
    visited.resize(n, false);
    cout<<dfs(i)<<endl;
  }
  return 0;
}


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

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

// varibable settings
#define int long long
const int INF=1e18;
const int MOD=1e9+7;

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

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

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

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

template<class T>
using V = vector<T>;

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

  V<V<pii>> s(n);
  rep(i, n){
    int a;cin>>a;
    rep(j, a){
      int x,y;cin>>x>>y;
      x--;
      s[i].pb(mp(x, y));
    }
  }

  int ans = 0;
  rep(mask, 1<<n){
    vi x(n);
    rep(i, n){
      if(mask&(1<<i)) x[i]=1;
    }
    dump(x);
    int sum = accumulate(all(x), 0LL);
    dump(sum);

    bool check=true;
    rep(i, n){
      each(el, s[i]){
        int j = el.first;
        int t = el.second;
        dump(i,j,t, x[i], x[j])
        if (t==1) {
          if (x[i]!=x[j]) check=false;
        }
        if (t==0) {
          if (x[i]==x[j]) check=false;
        }
      }
    }
    if (check) chmax(ans, sum);
  }
  cout << ans << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:85:9: error: expected ';' before 'if'
   85 |         if (t==1) {
      |         ^~
Language: C++

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

int n;
int a[15];
int y[15][15];
int x[15][15];

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

int maxHonest() {
    int c = 0;
    bool ok = true;
    for (int bit = n*n-2; bit >= 0; bit--){
        for (int i = 0; i < n; i++) {
            if (!ok) { break; }
            for (int j = 0; j < a[i]; j++){
                if (i == j) { continue; }
                if (((bit >> (x[i][j]-1)) & 1) != y[i][j]) { ok = false; break; }
            }
        }
        if (ok) { return countbit(bit); }
        if (!ok) { ok = true; }
    }
    return 0;
}

int main() {
    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];
        }
    }
    cout << maxHonest() << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int countbit(int)':
a.cc:11:12: error: 'counter' was not declared in this scope
   11 |     return counter(x >> 1) + (x & 1);
      |            ^~~~~~~
Language: C++

#if defined(__GNUC__)
#include <bits/stdc++.h>
// __GNUC__
#else
#include "bits/stdc++.h"
#endif
using namespace std;

#define int long long

#if defined(__GNUC__)
#define __int32 __int32_t
#endif // __GNUC__

#define itn __int32
#define REP(i, n) for(itn (i) = 0; (i) < (n); (i)++)
#define REP2(i, x, n) for(itn (i) = x; (i) < (n); (i)++)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define SORT(x) std::sort(ALL(x))
#define RSORT(x, T) std::sort(ALL(x), greater<T>())
#define REVERCE(x) std::reverce(ALL(x))

#define INT_POW(x, y) [](int a, int b) -> int {int c = a; REP(i, b - 1){c *= a;} return c;}(x, y)
#define INT_POWM(x, y, m) [](int a, int b, int m) -> int {int c = a; REP(i, b - 1){c *= a; c %= m;} return c;}(x, y, m)

itn main() {
	std::ios::sync_with_stdio(false);

	itn n;

	std::cin >> n;

	std::vector<std::vector<itn>> s(n);

	REP(i, n) {
		s[i].resize(n);
		REP(j, n) {
			s[i][j] = -1;
		}
	}

	itn a;
	itn x, y;

	REP(i, n) {
		std::cin >> a;
		REP(j, a) {
			std::cin >> x >> y;
			s[i][x - 1] = y;
		}
	}

	vector<int> sucptr;
	bool not_reg;

	REP(i, 1 << n) {
		not_reg = false;
		REP(j, n) {
			REP(k, n) {
				if (j == k || s[j][k] == -1) {
					continue;
				}
				if (!!(s[j][k] ^ !(!!(i & (1 << j)))) ^ !!(i & (1 << k))) {
					not_reg = true;
					break;
				}
			}
			if (not_reg) {
				break;
			}
		}
		if (!not_reg) {
			sucptr.push_back(i);
		}
	}

	int res = 0;
	int tmp;

	REP(i, sucptr.size()) {
		tmp = (sucptr[i] & 0x55555555) + (sucptr[i] >> 1 & 0x55555555);
		tmp = (tmp & 0x33333333) + (tmp >> 2 & 0x33333333);
		tmp = (tmp & 0x0f0f0f0f) + (tmp >> 4 & 0x0f0f0f0f);
		tmp = (tmp & 0x00ff00ff) + (tmp >> 8 & 0x00ff00ff);
		tmp = (tmp & 0x0000ffff) + (tmp >> 16 & 0x0000ffff);

		res = max(res, tmp);
	}
  
  res = max(res, 16 - res)

	cout << res;

	return 0;
}


Compiler output:
a.cc: In function '__int32_t main()':
a.cc:91:27: error: expected ';' before 'cout'
   91 |   res = max(res, 16 - res)
      |                           ^
      |                           ;
   92 | 
   93 |         cout << res;
      |         ~~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <algorithm>

using namespace std;

typedef struct datum_name{
	int x;
	int y;
	int whosay;
	bool operator==(const datum_name &data) const
	{
		return (x == data.x && y == data.y);
	}
} datum;

typedef vector<datum> all_data;
typedef vector<bool> honest_data;

bool cmp_who(const datum &left, const datum &right) {
	return left.whosay < right.whosay;
}

bool cmp_xval(const datum& left, const datum& right) {
	return left.x < right.x;
}

bool cmp_yval(const datum& left, const datum& right) {
	return left.y < right.y;
}


bool logical_check(all_data data_in, honest_data honest_list) {
	all_data data = data_in;
	for (unsigned int i = 0; i < data.size(); i++) {
		if (honest_list[data[i].whosay-1] == false) {
			data[i].x = 0;
			data[i].y = 0;
		}
	}
	sort(data.begin(), data.end(), cmp_xval);
	data.erase(unique(data.begin(), data.end()), data.end()); // 個人ごとに評価データを抽出
	if (data.size() == 0) return true;
	for (unsigned int i = 0; i < data.size(); i++) {
		if (data[i].x == 0) continue;
		if (honest_list[data[i].x-1] != (bool)(data[i].y)) return false;
	}
	for (unsigned int i = 0; i < data.size() - 1; i++) {
		if (data[i].x == data[i + 1].x) return false;
	}
	return true;
}

int count_false(honest_data& honest_list) {
	int count = 0;
	for (unsigned int i = 0; i < honest_list.size(); i++) {
		if (honest_list[i] == false) count++;
	}
	return count;
}

int main()
{
	int N;
	cin >> N;
	all_data data; //証言データ
	honest_data honest_list;
	honest_list.resize(N);

	for (int i = 0; i < N; i++) {
		int data_num;
		cin >> data_num;

		for (int j = 0; j < data_num; j++) {
			datum tmp_datum;
			cin >> tmp_datum.x >> tmp_datum.y;
			tmp_datum.whosay = i + 1;
			data.push_back(tmp_datum);
		}
		honest_list[i] = true;
	} // read all data
	logical_check(data,honest_list);
	int max_num = 0;
	while (true) {
		// falseを増やしながら全探索
		bool upcount = false;
		if (honest_list[0] == true) {
			honest_list[0] = false;
			upcount = false;
		}else { // fale->trueは繰り上がり
			honest_list[0] = true;
			upcount = true;
		}
		for (int i = 1; i < N; i++) {
			if (upcount) {
				honest_list[i] = !(honest_list[i]);
				if (honest_list[i] == false) {
					upcount = false;
					break;
				}
			}
		}
		bool check_res = logical_check(data, honest_list);
		int honest_num = N - count_false(honest_list);
		if (check_res) {
			max_num = max(max_num, honest_num);
		}
		if (honest_num==0) break;
	}
	cout << max_num << endl;
	return 0;


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

#include <bits/stdc++.h>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:29:24: error: expected ';' before ')' token
   29 |         for(int i=0;i++)
      |                        ^
      |                        ;
Language: C++

#include <iostream>
#include <vector>

using namespace std;

static const int MAX = 15;
int N;
int judge(int num, vector<int>& T);
vector< vector<int> > M(MAX, vector<int>(MAX, -1));


int main() {

    cin >> N;

    int iter;
    for (int i =0; i < N; i++) {
        cin >> iter;
        for (int j = 0; j < iter; j++) {
            int a, b;
            cin >> a >> b;
            a--;
            M[i][a] = b;
        }
    }

    int ans = 0;
    for (int bit = 0; bit < (1 << N); bit++) {

        vector<int> T(N, -1);  // judge vec

        for (int i = 0; i < N; i++) {
            if (bit & (1 << i)) {
                T[i] = 1;
            }
            else {
                T[i] = 0;
            }
        }
        int can = 1;  // Flag
        int cnt = 0;
        for (int i = 0; i < N; i++) {
            if (T[i] == 1) {
                cnt++;
                can *= judge(i, T);
            }
        }
        if (can) {
                ans = max(ans, cnt);
        }
    }

    cout << ans << '\n';

}

int judge(int num, vector<int>& T) {

    int can = 1;
    for (int i = 0; i < N; i++) {

        if (M[num][i] == -1) {
            continue;
        }
        else if (T[i] != M[num][i]) {
            can = 0;
            break;
        }
    }
    for (int i = 0; i < N; i++) {
    return can;

}


Compiler output:
a.cc: In function 'int judge(int, std::vector<int>&)':
a.cc:73:2: error: expected '}' at end of input
   73 | }
      |  ^
a.cc:57:36: note: to match this '{'
   57 | int judge(int num, vector<int>& T) {
      |                                    ^
a.cc:73:2: warning: control reaches end of non-void function [-Wreturn-type]
   73 | }
      |  ^
Language: C++

#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long ll;
ll dp[100005];
ll a[100005];
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[25][25], y[25][25];
	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];
		}
	}
	int ans = 0;
	for (int bit = 1; bit < (1 << n); bit++) {
		bool ok = true;
		for (int i = 0; i <= n; i++) {
			if (!(bit & (1 << (i - 1))))continue;
			for (int j = 1; j <= a[i]; j++) {
				if (((bit >> (x[i][j] - 1)) & 1) ^ y[i][j]) {
					ok = false;
				}
			}
		}
	
		if (ok) {
			ans = max(ans, counter(bit));
		}
    }
	cout << ans << endl;
	return;

}

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

use std::io::*;
use std::str::FromStr;

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: usize = read();
    let mut v: Vec< Vec< (usize, bool) >> = vec![vec![]; n];
    for i in 0..n {
        let a: usize = read();
        for _ in 0..a {
            let j: usize = read();
            let x: u8 = read();
            v[i].push((j-1, if x == 1 { true } else { false }));
        }
    }

    let mut ans: u8 = 0;

    for bit in 0..(1<<n) {
        let mut is_honest = vec![false; n];
        let mut cnt: u8  = 0;
        for i in 0..n {
            if bit & (1 << i) != 0 {
                is_honest[i] = true;
                cnt += 1;
            }
        }

        let mut ok = true;
        for i in 0..n {
            if !is_honest[i] {
                continue;
            }
            for j in 0..(v[i].len()) {
                if is_honest[v[i][j].0] != v[i][j].1 {
                    ok = false;
                    break;
                }
            }
            if !ok {
                break;
            }
        }
        
        if ok && ans < cnt {
            ans = cnt;
        }
    }

    println!("{}", ans);
}

Compiler output:
a.cc:19:14: error: too many decimal points in number
   19 |     for i in 0..n {
      |              ^~~~
a.cc:21:18: error: too many decimal points in number
   21 |         for _ in 0..a {
      |                  ^~~~
a.cc:30:16: error: too many decimal points in number
   30 |     for bit in 0..(1<<n) {
      |                ^~~
a.cc:33:18: error: too many decimal points in number
   33 |         for i in 0..n {
      |                  ^~~~
a.cc:41:18: error: too many decimal points in number
   41 |         for i in 0..n {
      |                  ^~~~
a.cc:45:22: error: too many decimal points in number
   45 |             for j in 0..(v[i].len()) {
      |                      ^~~
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:4:1: error: 'fn' does not name a type
    4 | fn read<T: FromStr>() -> T {
      | ^~
a.cc:16:1: error: 'fn' does not name a type
   16 | fn main() {
      | ^~
Language: Java


import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int totalPerson = sc.nextInt();
        Boolean[] judgeFlag = new boolean[totalPerson];
        int count = 0;

        for(int i=0; i<totalPerson; i++){
            judgeFlag[i] = true;    //正直者
        }

        for(int i=0; i<totalPerson; i++){
            int person = sc.nextInt();
            for(int j=0; j<person; j++){
                int x = sc.nextInt();
                int y = sc.nextInt();

                if(y == 1){
                    judgeFlag[x-1] = true;
                }else if(y == 0){
                    judgeFlag[x-1] = false;
                }
            }
        }
        for(int i=0; i<totalPerson; i++){
            if(judgeFlag[i] == true){ //正直者
                count++;
            }
        }
        System.out.println(count);
    }
}

Compiler output:
Main.java:9: error: incompatible types: boolean[] cannot be converted to Boolean[]
        Boolean[] judgeFlag = new boolean[totalPerson];
                              ^
1 error
Language: C++

#include <iostream>
#include <fstream>
#include <bits/stdc++.h>
#include <map>
#define pb push_back
#define ll long long
#define pii pair<int,int>
#define pll pair<long,long>
using namespace std;
ifstream fin("f.in");
ofstream fout("f.out");
int N,ans,A[20];
int x[20][20],y[20][20];
vector <dubla> v(30);
int solve(int x)
{
    
} 
int main()
{
    int i,j;
    cin>>N;
    for(i=1;i<=N;i++)
    {
        cin>>A[i];
        for(j=1;j<=A[i];j++)
        {
            cin>>x[i][j]>>y[i][j];
        }
    }
    for(i=0;i<pow(2,n);i++)
    {
        ans=max(ans,solve(i));
    }
    cout<<ans;
    fin.close();
    fout.close();
    return 0;
}


Compiler output:
a.cc:14:9: error: 'dubla' was not declared in this scope
   14 | vector <dubla> v(30);
      |         ^~~~~
a.cc:14:14: error: template argument 1 is invalid
   14 | vector <dubla> v(30);
      |              ^
a.cc:14:14: error: template argument 2 is invalid
a.cc: In function 'int solve(int)':
a.cc:18:1: warning: no return statement in function returning non-void [-Wreturn-type]
   18 | }
      | ^
a.cc: In function 'int main()':
a.cc:31:21: error: 'n' was not declared in this scope
   31 |     for(i=0;i<pow(2,n);i++)
      |                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const double PI=3.14159265358979323846;
const int64_t waru = 1000000007;
using in = int64_t;

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

  int x,y;
  rep(i,n){
      vector<pair<int,int>> c(0);
     cin>>a.at(i);
    rep(j,a.at(i)){
       cin>>x>>y;
      c.push_back(make_pair(x,y));
    }
    b.push_back(c);
  }
  for(c:auto t) cout<<t<<endl;
  
  int ans=0;
  int cnt;
  int tftf=0;
  bool bol;
  //cout<<b.at(1).at(0).second<<endl;
  for (int tmp = 0; tmp < (1 <<n); tmp++) {
    bitset<15> tf(tmp);
  
    rep(i,n){
       if(!tf.test(i)) continue;
     // else cout<<1<<endl;
      rep(j,a.at(i)){
        bol =(b.at(i).at(j).second==1);
        x= b.at(i).at(j).first;
        
      if((bol && tf.test(x-1)) || (!bol && !tf.test(x-1))) continue;
        else
      {tftf=1; break;}//goto SKIP;
      }//repj
    }//repi
    if(tftf==0){cnt = tf.count();
                          //cout<<tf<<endl;
    ans=max(cnt,ans);}
    //SKIP:
  }//reptmp
  cout<<ans;
}//main

Compiler output:
a.cc: In function 'int main()':
a.cc:25:7: error: 'c' was not declared in this scope
   25 |   for(c:auto t) cout<<t<<endl;
      |       ^
a.cc:28:3: error: expected primary-expression before 'int'
   28 |   int cnt;
      |   ^~~
a.cc:27:13: error: expected ')' before 'int'
   27 |   int ans=0;
      |             ^
      |             )
   28 |   int cnt;
      |   ~~~        
a.cc:25:6: note: to match this '('
   25 |   for(c:auto t) cout<<t<<endl;
      |      ^
a.cc:47:17: error: 'cnt' was not declared in this scope; did you mean 'int'?
   47 |     if(tftf==0){cnt = tf.count();
      |                 ^~~
      |                 int
a.cc:49:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   49 |     ans=max(cnt,ans);}
      |     ^~~
      |     abs
a.cc:52:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   52 |   cout<<ans;
      |         ^~~
      |         abs
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;
	int fa[n+1];
	for(int i=1;i<=n;i++)
	{
		fa[i]=i;
	}
	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];
			fa[max(i,x[i][j])]=fa[min(i,x[i][j])];
		}
	}
	int f[n+1];
	for(int i=1;i<=n;i++)
	{
		f[i]=0;
	}
	for(int i=1;i<=n;i++)
	{
		f[fa[i]]++;
	}
	int max=0;
	for(int i=1;i<=n;i++)
	{
		if(f[i]>max)
		{
			max=f[i];
		}
	}
	cout<<max<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:22: error: 'a' was not declared in this scope
   14 |                 cin>>a[i];
      |                      ^
a.cc:17:30: error: 'x' was not declared in this scope
   17 |                         cin>>x[i][j]>>y[i][j];
      |                              ^
a.cc:17:39: error: 'y' was not declared in this scope
   17 |                         cin>>x[i][j]>>y[i][j];
      |                                       ^
Language: C

#include<stdio.h>
int main(){
	int n;
	int x[16];
	int cnt=0;
	scanf("%d",&n);
	for(){
		int a;
		scanf("%d",&a);
		int y=1;
		for(int i=0;i<a;i++){
			scanf("%d",x[i]);
			if(x[i])y=0;
		}
		cnt+=y;
	}
	printf("%d",cnt);
}

Compiler output:
main.c: In function 'main':
main.c:7:13: error: expected expression before ')' token
    7 |         for(){
      |             ^
main.c:7:13: error: expected expression before ')' token
Language: C

#include <stdio.h>
int main(void){
  	int t[15],f[15];
	int ans;
  	int n,i;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		int k;
      	scanf("%d",&k);
		for(;k--;){
			int a,b;
          	scanf("%d%d",&a,&b);
			i[b?t:f]| = 1 << a-1;
		}
	}
	
  	for(i=0;i<1<<n;i++){
		int true=i,false=0,j;
		for(j=2;j--;){
          for(int l=0;l<n;l++){
            if(true>>l&1) true|=T[l],false|=F[l];
          }
        }
		ans=fmax(ans,true&false?0:__builtin_popcount(i));
	}
	printf("%d\n",ans);
}


Compiler output:
main.c: In function 'main':
main.c:13:35: error: expected expression before '=' token
   13 |                         i[b?t:f]| = 1 << a-1;
      |                                   ^
main.c:21:33: error: 'T' undeclared (first use in this function)
   21 |             if(true>>l&1) true|=T[l],false|=F[l];
      |                                 ^
main.c:21:33: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:45: error: 'F' undeclared (first use in this function)
   21 |             if(true>>l&1) true|=T[l],false|=F[l];
      |                                             ^
main.c:24:21: error: implicit declaration of function 'fmax' [-Wimplicit-function-declaration]
   24 |                 ans=fmax(ans,true&false?0:__builtin_popcount(i));
      |                     ^~~~
main.c:2:1: note: include '<math.h>' or provide a declaration of 'fmax'
    1 | #include <stdio.h>
  +++ |+#include <math.h>
    2 | int main(void){
main.c:24:21: warning: incompatible implicit declaration of built-in function 'fmax' [-Wbuiltin-declaration-mismatch]
   24 |                 ans=fmax(ans,true&false?0:__builtin_popcount(i));
      |                     ^~~~
main.c:24:21: note: include '<math.h>' or provide a declaration of 'fmax'
Language: C

int main(void){
  	int t[15],f[15];
	int ans;
  	int n,i;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		int k;
      	scanf("%d",&k);
		for(;k--;){
			int a,b;
          	scanf("%d%d",&a,&b);
			i[b?t:f]| = 1 << a-1;
		}
	}
	
  	for(i=0;i<1<<n;i++){
		int true=i,false=0,j;
		for(j=2;j--;){
          for(int l=0;l<n;l++){
            if(true>>l&1) true|=T[l],false|=F[l];
          }
        }
		ans=fmax(ans,true&false?0:__builtin_popcount(i));
	}
	printf("%d\n",ans);
}

Compiler output:
main.c: In function 'main':
main.c:5:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |         scanf("%d",&n);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(void){
main.c:5:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |         scanf("%d",&n);
      |         ^~~~~
main.c:5:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:12:35: error: expected expression before '=' token
   12 |                         i[b?t:f]| = 1 << a-1;
      |                                   ^
main.c:20:33: error: 'T' undeclared (first use in this function)
   20 |             if(true>>l&1) true|=T[l],false|=F[l];
      |                                 ^
main.c:20:33: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:45: error: 'F' undeclared (first use in this function)
   20 |             if(true>>l&1) true|=T[l],false|=F[l];
      |                                             ^
main.c:23:21: error: implicit declaration of function 'fmax' [-Wimplicit-function-declaration]
   23 |                 ans=fmax(ans,true&false?0:__builtin_popcount(i));
      |                     ^~~~
main.c:1:1: note: include '<math.h>' or provide a declaration of 'fmax'
  +++ |+#include <math.h>
    1 | int main(void){
main.c:23:21: warning: incompatible implicit declaration of built-in function 'fmax' [-Wbuiltin-declaration-mismatch]
   23 |                 ans=fmax(ans,true&false?0:__builtin_popcount(i));
      |                     ^~~~
main.c:23:21: note: include '<math.h>' or provide a declaration of 'fmax'
main.c:25:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   25 |         printf("%d\n",ans);
      |         ^~~~~~
main.c:25:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:25:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:25:9: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

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

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

int main() {
  int n;
  cin >> n;
  int a[20];
  int x[20][20];
  int y[20][20];
  int ans = 0;

  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 ok = true; //矛盾したらfalse
    for (int i = 0; i < n; i++) {
      if (!(bit & (1 << i))){
        continue;
      }
      for (int j = 0; j < a[i]; j++) {
        if (((bit >> (x[i][j])) & 1) ^ y[i][j]) {
          ok = false;
        }
      }
    }
    if (ok) {
      ans = max(ans, counter(bit));
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc:7:4: error: extended character 　 is not valid in an identifier
    7 |   }　else {
      |    ^
a.cc: In function 'int counter(int)':
a.cc:7:4: error: '\U00003000else' was not declared in this scope
    7 |   }　else {
      |    ^~~~~~
a.cc:10:1: warning: control reaches end of non-void function [-Wreturn-type]
   10 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<vector<pair<int,int>>> test(n);
  for(int i=0; i<n; i++){
    int a;
    cin>>a;
    for(int j=0; j<a; j++){
      pair<int,int> p;
      cin>>p.first>>p.second;
      test.at(i).push_back(p);
    }
  }
  int ans=0;
  for(int tmp=0; tmp<(1<<n); tmp++){
    bool ok=true;
    bitset<15> ho(tmp);
    for(int i=0; i<n;i++){
      int l=test.at(i).size();
      if(ho.test(i)){
        for(int j=0; j<l;j++){
          int hito=test.at(i).at(j).first-1;
          int honest=test.at(i).at(j).second;
          if(ho.test(hito)!=honest) ok=false;
        }
      }
      else{
        for(int j=0; j<l;j++){
          int hito=test.at(i).at(j).first-1;
          int honest=test.at(i).at(j).second;
          if(ho.test(hito)==honest) ok=false;
        }
      }
    }
    if(ok) ans=max(ans, ho.count());
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:19: error: no matching function for call to 'max(int&, std::size_t)'
   37 |     if(ok) ans=max(ans, ho.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:37:19: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::size_t' {aka 'long unsigned int'})
   37 |     if(ok) ans=max(ans, ho.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:37:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   37 |     if(ok) ans=max(ans, ho.count());
      |                ~~~^~~~~~~~~~~~~~~~~
Language: C++

using namespace std;

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

int main() {

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:2: error: 'cin' was not declared in this scope
   15 |  cin >> N;
      |  ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:32:27: error: 'max' was not declared in this scope
   32 |   if(judge == true) ans = max(ans, counter(bits));
      |                           ^~~
a.cc:34:8: error: 'cout' was not declared in this scope
   34 |        cout << ans << endl;
      |        ^~~~
a.cc:34:8: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:34:23: error: 'endl' was not declared in this scope
   34 |        cout << ans << endl;
      |                       ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int counter(int x) {
  bitset<20> b(x);
  return b.count();
}
int main() {
  int N;
  cin >> N;
  int A[20];
  int x[20][20];    //x[i][j] i番目の人のj番目の発言の人を指定する箇所
  int y[20][20];    //y[i][j] i番目の人のj番目の発言の真偽を指定する箇所
  
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    for (int j = 0; j < N; j++) {
      cin >> x[i][j];
      cin >> y[i][j];
    }
  }
  
  
  bool ans = true;
  int num = 0;
  for (int tmp = 0; tmp < (1 << N); tmp++ ) {   //全パターンチェック
    bitset<N> b(tmp);      //bitに変換
    for (int i = 0; i < N; i++) {    //一人一人についてチェックしていく
      if (b.test(i)) {        //まず、i番目の人自身の真偽チェック
        for (int j = 0; j < A[i]; j++) {  //真なら、その人の発言をチェックしていく
          if (b[x[i][j]] != y[i][j]) {
            ans = false;
          }
          else 
            num = max(num,counter(int tmp));
        }
      }
    }
  }
  cout << num << endl;
}

     

        
        

Compiler output:
a.cc: In function 'int main()':
a.cc:26:13: error: the value of 'N' is not usable in a constant expression
   26 |     bitset<N> b(tmp);      //bitに変換
      |             ^
a.cc:8:7: note: 'int N' is not const
    8 |   int N;
      |       ^
a.cc:26:13: note: in template argument for type 'long unsigned int'
   26 |     bitset<N> b(tmp);      //bitに変換
      |             ^
a.cc:28:13: error: request for member 'test' in 'b', which is of non-class type 'int'
   28 |       if (b.test(i)) {        //まず、i番目の人自身の真偽チェック
      |             ^~~~
a.cc:30:16: error: invalid types 'int[int]' for array subscript
   30 |           if (b[x[i][j]] != y[i][j]) {
      |                ^
a.cc:34:35: error: expected primary-expression before 'int'
   34 |             num = max(num,counter(int tmp));
      |                                   ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int counter(int x) {
  bitset<20> b(x);
  return b.count();
}
int main() {
  int N;
  cin >> N;
  int A[20];
  int x[20][20];    //x[i][j] i番目の人のj番目の発言の人を指定する箇所
  int y[20][20];    //y[i][j] i番目の人のj番目の発言の真偽を指定する箇所
  
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
    for (int j = 0; j < N; j++) {
      cin >> x[i][j];
      cin >> y[i][j];
    }
  }
  
  
  bool ans = true;
  int num = 0;
  for (int tmp = 0; tmp < (1 << N); tmp++ ) {   //全パターンチェック
    bitset<N> b(tmp);      //bitに変換
    for (int i = 0; i < N; i++) {    //一人一人についてチェックしていく
      if (b.test(i)) {        //まず、i番目の人自身の真偽チェック
        for (int j = 0; j < A.at(i); j++) {  //真なら、その人の発言をチェックしていく
          if (b[x[i][j]] != y[i][j]) {
            ans = false;
          }
          else 
            num = max(num,counter(int tmp));
        }
      }
    }
  }
  cout << num << endl;
}

        
        

Compiler output:
a.cc: In function 'int main()':
a.cc:15:14: error: request for member 'at' in 'A', which is of non-class type 'int [20]'
   15 |     cin >> A.at(i);
      |              ^~
a.cc:26:13: error: the value of 'N' is not usable in a constant expression
   26 |     bitset<N> b(tmp);      //bitに変換
      |             ^
a.cc:8:7: note: 'int N' is not const
    8 |   int N;
      |       ^
a.cc:26:13: note: in template argument for type 'long unsigned int'
   26 |     bitset<N> b(tmp);      //bitに変換
      |             ^
a.cc:28:13: error: request for member 'test' in 'b', which is of non-class type 'int'
   28 |       if (b.test(i)) {        //まず、i番目の人自身の真偽チェック
      |             ^~~~
a.cc:29:31: error: request for member 'at' in 'A', which is of non-class type 'int [20]'
   29 |         for (int j = 0; j < A.at(i); j++) {  //真なら、その人の発言をチェックしていく
      |                               ^~
a.cc:30:16: error: invalid types 'int[int]' for array subscript
   30 |           if (b[x[i][j]] != y[i][j]) {
      |                ^
a.cc:34:35: error: expected primary-expression before 'int'
   34 |             num = max(num,counter(int tmp));
      |                                   ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int counter(int x) {
  bitset<20> b(x);
  return b.count();
}
int main() {
  int N;
  cin >> N;
  int A[20];
  int x[20][20];    //x[i][j] i番目の人のj番目の発言の人を指定する箇所
  int y[20][20];    //y[i][j] i番目の人のj番目の発言の真偽を指定する箇所
  
  for (int i = 0; int i < N; i++) {
    cin >> A.at(i);
    for (int j = 0; int j < N; j++) {
      cin >> x[i][j];
      cin >> y[i][j];
    }
  }
  
  
  bool ans = true;
  int num = 0;
  for (int tmp = 0; tmp < (1 << N); tmp++ ) {   //全パターンチェック
    bitset<N> b(tmp);      //bitに変換
    for (int i = 0; i < N; i++) {    //一人一人についてチェックしていく
      if (b.test(i)) {        //まず、i番目の人自身の真偽チェック
        for (int j = 0; j < A.at(i); j++) {  //真なら、その人の発言をチェックしていく
          if (b[x[i][j]] != y[i][j]) {
            ans = false;
          }
          else 
            num = max(num,counter(int tmp));
        }
      }
    }
  }
  cout << num << endl;
}

        
        

Compiler output:
a.cc: In function 'int main()':
a.cc:14:23: error: redeclaration of 'int i'
   14 |   for (int i = 0; int i < N; i++) {
      |                       ^
a.cc:14:12: note: 'int i' previously declared here
   14 |   for (int i = 0; int i < N; i++) {
      |            ^
a.cc:14:25: error: expected initializer before '<' token
   14 |   for (int i = 0; int i < N; i++) {
      |                         ^
a.cc:14:24: error: expected ';' before '<' token
   14 |   for (int i = 0; int i < N; i++) {
      |                        ^~
      |                        ;
a.cc:14:25: error: expected primary-expression before '<' token
   14 |   for (int i = 0; int i < N; i++) {
      |                         ^
a.cc:14:28: error: expected ')' before ';' token
   14 |   for (int i = 0; int i < N; i++) {
      |       ~                    ^
      |                            )
a.cc:14:30: error: 'i' was not declared in this scope
   14 |   for (int i = 0; int i < N; i++) {
      |                              ^
a.cc:26:13: error: the value of 'N' is not usable in a constant expression
   26 |     bitset<N> b(tmp);      //bitに変換
      |             ^
a.cc:8:7: note: 'int N' is not const
    8 |   int N;
      |       ^
a.cc:26:13: note: in template argument for type 'long unsigned int'
   26 |     bitset<N> b(tmp);      //bitに変換
      |             ^
a.cc:28:13: error: request for member 'test' in 'b', which is of non-class type 'int'
   28 |       if (b.test(i)) {        //まず、i番目の人自身の真偽チェック
      |             ^~~~
a.cc:29:31: error: request for member 'at' in 'A', which is of non-class type 'int [20]'
   29 |         for (int j = 0; j < A.at(i); j++) {  //真なら、その人の発言をチェックしていく
      |                               ^~
a.cc:30:16: error: invalid types 'int[int]' for array subscript
   30 |           if (b[x[i][j]] != y[i][j]) {
      |                ^
a.cc:34:35: error: expected primary-expression before 'int'
   34 |             num = max(num,counter(int tmp));
      |                                   ^~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>
#include <iomanip>
#include <map>
#include <cstdlib>
#include <cctype>
#include <ctype.h>
#define ll long long
using namespace std;
int main()
{
    int n;
    cin >> n;
    int a[n];
    int x[20][20];
    int y[20][20];
    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];
        }
    }
    int ans = 0;
    for (int bit = 0; bit < (1 << n) - 1; bit++)
    {
        int jud = 1;
        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < a[i]; j++)
            {
                if(bit &(1<<x))
                {
                    if(!(bit&(1<<x[i][j])))
                    {
                        if(y[i][j]==1)
                        {
                            jud = 0;
                        }
                    }
                }
                else
                {
                    if(bit &(1<<x[i][j]))
                    {
                        if(y[i][j]==1)
                        {
                            jud = 0;
                        }
                    }
                }
                
            }
        }
        if (jud == 1 && ans <= __builtin_popcount(bit))
        {
            ans = __builtin_popcount(bit);
        }
    }
    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:27: error: invalid operands of types 'int' and 'int [20][20]' to binary 'operator<<'
   35 |                 if(bit &(1<<x))
      |                          ~^~~
      |                          |  |
      |                          |  int [20][20]
      |                          int
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>
#include <iomanip>
#include <map>
#include <cstdlib>
#include <cctype>
#include <ctype.h>
#define ll long long
using namespace std;
int main()
{
    int n;
    cin >> n;
    int a[n];
    int x[20][20];
    int y[20][20];
    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];
        }
    }
    int ans = 0;
    for (int bit = 0; bit < (1 << n) - 1; bit++)
    {
        int jud = 1;
        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < a[i]; j++)

             if (!(bit & (1 << x[i][j])))
            {
                if (y[i][j] == 1)
                {
                    jud = 0;
                    break;
                }
            }
        }
    }
    if (jud == 1 && ans <= __builtin_popcount(bit))
    {
        ans = __builtin_popcount(bit);
    }
}
cout << ans << endl;

return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:9: error: 'jud' was not declared in this scope
   45 |     if (jud == 1 && ans <= __builtin_popcount(bit))
      |         ^~~
a.cc:45:47: error: 'bit' was not declared in this scope
   45 |     if (jud == 1 && ans <= __builtin_popcount(bit))
      |                                               ^~~
a.cc: At global scope:
a.cc:50:1: error: 'cout' does not name a type
   50 | cout << ans << endl;
      | ^~~~
a.cc:52:1: error: expected unqualified-id before 'return'
   52 | return 0;
      | ^~~~~~
a.cc:53:1: error: expected declaration before '}' token
   53 | }
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>
#include <iomanip>
#include <map>
#include <cstdlib>
#include <cctype>
#include <ctype.h>
#define ll long long
using namespace std;
int main()
{
    int n;
    cin >> n;
    int a[n];
    int x[20][20];
    int y[20][20];
    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];
        }
    }
    int ans = 0;
    for (int bit = 0; bit < (1 << n) - 1; bit++)
    {
        int jud = 1;
        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < a[i]; j++)
            {
                if (bit & (1 << x[i][j]))
                {
                    if (!(bit & (1 << x[i][j])))
                    {
                        if (y[i][j] == 1)
                        {
                            jud = 0;
                        }
                    }
                }
            }
            if (jud == 1 && ans <= __builtin_popcount(bit))
            {
                ans = __builtin_popcount(bit);
            }
        }
        cout << ans << endl;

        return 0;
    }


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

#include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>
#include <iomanip>
#include <map>
#include <cstdlib>
#include <cctype>
#include <ctype.h>
#define ll long long
using namespace std;
int main()
{
    int n;
    int a[20];
    cin >> n;
    vector<vector<int>> x;
    vector<vector<int>> y;
    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];
        }
    }
    int ans = 0;
    for (int bit = 0; bit < (1 << n) - 1; bit++)
    {
        int jud = 0;
        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < a[i]; j++)
            {
                if (bit & x[i][j])
                {
                    if (y[i][j] == 0)
                    {
                        jud = 1;
                    }
                }
            }
        }
        if (jud = 0 && ans <= bit)
        {
            ans = __builtin_popcount(bit)
        }
    }
    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:42: error: expected ';' before '}' token
   46 |             ans = __builtin_popcount(bit)
      |                                          ^
      |                                          ;
   47 |         }
      |         ~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>
#include <iomanip>
#include <map>
#include <cstdlib>
#include <cctype>
#include <ctype.h>
#define ll long long
char toupper(char c);
char toupper(char c)
{
    return (c - 0x20);
}

using namespace std;
int main()
{
    int n, a;
    cin >> n;
    vector<vector<int>> x;
    vector<vector<int>> y;
    for (int i = 0; int < n; i++)
    {
        cin >> a;
        for (int j = 0; j < a;j++)
        {
            cin >> x[i][j] >> y[i][j];
        }
    }
    int ans = 0;
    for (int bit = 0; bit < n-1; bit++)
    {
        int sum = 0;
        for (int i = 0; i < a[bit];i++)
        {
            if(bit &x[bit][i])
            {

            }
            else{
                break;
            }
            
        }
        if(ans<=sum)
        {
            ans = sum;
        }
    }
    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:21: error: 'int' is not a template
   24 |     for (int i = 0; int < n; i++)
      |                     ^~~
a.cc:24:21: error: expected primary-expression before 'int'
a.cc:24:20: error: expected ';' before 'int'
   24 |     for (int i = 0; int < n; i++)
      |                    ^~~~
      |                    ;
a.cc:24:21: error: expected primary-expression before 'int'
   24 |     for (int i = 0; int < n; i++)
      |                     ^~~
a.cc:24:20: error: expected ')' before 'int'
   24 |     for (int i = 0; int < n; i++)
      |         ~          ^~~~
      |                    )
a.cc:24:21: error: declaration does not declare anything [-fpermissive]
   24 |     for (int i = 0; int < n; i++)
      |                     ^~~
a.cc:24:30: error: 'i' was not declared in this scope
   24 |     for (int i = 0; int < n; i++)
      |                              ^
a.cc:36:30: error: invalid types 'int[int]' for array subscript
   36 |         for (int i = 0; i < a[bit];i++)
      |                              ^