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;
typedef long long int ll;

int main() {
  int n; cin >> n;
  int a[20], x[20][20], y[20][20];
  rep(i, n) {
    cin >> a[i];
    rep(j, a[i]) {
    cin >> x[i][j] >> y[i][j]; x[i][j]--;
    }
  }
  int ans = 0;
  for (int s = 0; s < (1<<n); s++) {
    bool flog = 1;
    int cnt = 0;
    for (int i = 0; i < n; i++) {
      if (s & (1<<i)) {
        cnt++;
        for (int j = 0; j < a[i]; j++) {
          if (y[i][j] && !(s & 1<<x[i][j])) flog = 0;
          if (!y[i][j] && (s & 1<<x[i][j])) flog = 0;
        }
      }
    }
    if (flog) ans = max(ans, cnt);
  }
  cout << ans << endl;
  return 0;
}


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 ll long long int
using namespace std;
int n, a[16], p[16][16], q[16][16], ans;
int main()
{
   cin>>n;
   for(int i = 0; i < n; i++)
   {
   	cin >> a[i];
   	for(int j = 0; j < a[i] ; j++)
   	{
   		cin >> p[i][j] >> q[i][j];
   		p[i][j]--;
   	}
   }
   for(int i = 0; i < (1<<n) ; i++)
   {
   	  bool ok = true;
   	  ll cnt = 0;
   	  for(int j=0; j < n; j++)
   	  {
            if((1ll << j) & i)
            {
            	cnt++;
            	for(int k = 0; k < a[j]; k++)
            	{
            		if ((((1ll << p[j][k]) & i) and !q[j][k]) or ((!((1ll << p[j][k]) & i) and q[j][k])))ok = false;
            	}
            }
   	  }
   	  if(ok)ans = max(ans,cnt);
   }
   cout << ans << "\n";
}


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

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

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

void input() {
	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 counter(int x) {
	if (x == 0) return 0;
	return counter(x >> 1) + (x & 1); 
}

void solve() {
	input();
	int ans = 0;   

	
	for (int bits = 1; bits < (1 << N);bits++) {
		bool judge = 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]) judge = false;  
            }
		}
		if (judge) ans = max(ans, counter(bits));
	}
	cout << ans << endl;
	return;
}


Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

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

int N;
int A[20];
int x[20][20];
int y[20][20];
// "<<"　左シフト演算　
// ">>" 右シフト演算
// "&" AND演算(ビット積)
// "^" 排他的論理和
void input() {
	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 counter(int x) {
	if (x == 0) return 0;
	return counter(x >> 1) + (x & 1); //2進数の並びを、フラグの数の合計にして返すカウンタ関数
}

void solve() {
	input();
	int ans = 0;   

	//, 0 以上 2^N 未満の整数 j が「1 以上 N 以下の整数 k について, 人 k が正直者であることと, 
	//j を 2 進数表記した際に k−1 桁目が 1 であることが同値」という状態を表すことと定義すると, 容易に全ての場合を試すことが出来る。 
	//この手法は bit 全探索と呼ばれる。

	for (int bits = 1; bits < (1 << N);bits++) {//bit全探索　すべての組み合わせ
		bool judge = true;
		for (int i = 1; i <= N; i++) {//A[i]について
			if (!(bits & (1 << (i - 1)))) continue;  //フラグがない
			for (int j = 1; j <= A[i]; j++) { //bitsのi-1番目のフラグがある
				if (((bits >> (x[i][j] - 1)) & 1) ^ y[i][j]) judge = false;  //矛盾がある： 正直者と仮定している中で不親切だという証言があった
			}
		}
		if (judge) ans = max(ans, counter(bits));
	}
	cout << ans << endl;
	return;
}


Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

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

int N;
int A[20];
int x[20][20];
int y[20][20];
// "<<"　左シフト演算　
// ">>" 右シフト演算
// "&" AND演算(ビット積)
// "^" 排他的論理和
void input() {
	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 counter(int x) {
	if (x == 0) return 0;
	return counter(x >> 1) + (x & 1); //2進数の並びを、フラグの数の合計にして返すカウンタ関数
}

void solve() {
	input();
	int ans = 0;   

	//, 0 以上 2^N 未満の整数 j が「1 以上 N 以下の整数 k について, 人 k が正直者であることと, 
	//j を 2 進数表記した際に k−1 桁目が 1 であることが同値」という状態を表すことと定義すると, 容易に全ての場合を試すことが出来る。 
	//この手法は bit 全探索と呼ばれる。

	for (int bits = 1; bits < (1 << N);bits++) {//bit全探索　すべての組み合わせ
		bool judge = true;
		for (int i = 1; i <= N; i++) {//A[i]について
			if (!(bits & (1 << (i - 1)))) continue;  //フラグがない
			for (int j = 1; j <= A[i]; j++) { //bitsのi-1番目のフラグがある
				if (((bits >> (x[i][j] - 1)) & 1) ^ y[i][j]) judge = false;  //矛盾がある： 正直者と仮定している中で不親切だという証言があった
			}
		}
		if (judge) ans = max(ans, counter(bits));
	}
	cout << ans << endl;
	return;
}


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

// コンテスト後

package main

import (
	"fmt"
)

func honest(n int, i uint) int {
	return (n >> i) & 1
}

func honestsNum(n int) int {
	ret := 0
	for i := 0; n > 0; i++ {
		if n&1 == 1 {
			ret++
		}
		n >>= 1
	}
	return ret
}

func max(nums ...int) int {
	ret := nums[0]
	for _, v := range nums {
		if v > ret {
			ret = v
		}
	}
	return ret
}

func main() {
	var n uint
	fmt.Scan(&n)
	a := make([]int, n)
	x := make([][]int, n)
	y := make([][]int, n)
	for i := uint(0); i < n; i++ {
		fmt.Scan(&a[i])
		x[i] = make([]int, a[i])
		y[i] = make([]int, a[i])
		for j := 0; j < a[i]; j++ {
			fmt.Scan(&x[i][j], &y[i][j])
			x[i][j]--
		}
	}

	// bit全探索
	iMax := 1 << n
	ans := 0 // i = 0のとき
	for i := 1; i < iMax; i++ {
		ok := true
		for j := uint(0); j < n; j++ {
			if honest(i, j) == 0 {
				continue
			}
			for k := 0; k < a[j]; k++ {
				if honest(i, uint(x[j][k])) != y[j][k] {
					ok = false
					break
				}
			}
			if !ok {
				break
			}
		}
		if ok {
			ans = max(ans, honestsNum(i))
		}
	}

	fmt.Println(ans)
}


Compiler output:
a.cc:3:1: error: 'package' does not name a type
    3 | package main
      | ^~~~~~~
a.cc:13:1: error: 'func' does not name a type
   13 | func honestsNum(n int) int {
      | ^~~~
a.cc:24:1: error: 'func' does not name a type
   24 | func max(nums ...int) int {
      | ^~~~
a.cc:34:1: error: 'func' does not name a type
   34 | func main() {
      | ^~~~
Language: C++

#define 
#include <bits/stdc++.h>

using namespace std;

int main() {
#ifdef  DEBUG
  ifstream in("input.txt");
  cin.rdbuf(in.rdbuf());
#endif  // for local.
  int n;
  cin >> n;
  int wild = 0;
  for (int bit = 0; bit < n; bit++) {
    wild |= (1<<bit);
  }
  int cond[n];
  int mask[n];
  int m;
  int x, y;
  for (int i = 0; i < n; i++) {
    cond[i] = wild;
    mask[i] = 0;
    cin >> m;
    for (int j = 0; j < m; j++) {
      cin >> x >> y;
      cond[i] &= (y<<(x-1));
      mask[j] |= (1<<(x-1)); 
    }
  }
  int ans = 0;
  int condnow;
  int masknow;
  for (int i = 0; i <= wild; i++) {
    condnow = wild;
    masknow = 0;
    for (int j = 0; j < n; j++) {
      if (i & (1<<j)) {
        condnow &= cond[j];
        masknow |= mask[j];
      }
    }
    if ((i&masknow) == (condnow&masknow)) {
      if (ans < __builtin_popcount(a)) {
        ans =  __builtin_popcount(a);
      }
    }
  }
  
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc:1:9: error: no macro name given in #define directive
    1 | #define
      |         ^
a.cc: In function 'int main()':
a.cc:44:36: error: 'a' was not declared in this scope
   44 |       if (ans < __builtin_popcount(a)) {
      |                                    ^
Language: C++

n = int(input())
ret = {}
for i in range(0, n):
    a = int(input())
    ret[i] = [[], []]
    for j in range(a):
        x, y = map(int, input().split())
        x -= 1
        if y == 1:
            ret[i][0].append(x)
        elif y == 0:
            ret[i][1].append(x)
 
dic = {}
 
 
def f(honest_p):
    if honest_p in dic:
        return []
    dic[honest_p] = True
    # print('honest_list: ', honest_p)
    if ret[honest_p][0] == []:
        return [honest_p]
    temp = [honest_p]
    for i in ret[honest_p][0]:
        temp += f(i)
    return temp
 
 
ans = 0
for i in range(0, n):
    dic = {}
    honest = list(set(f(i)))
    # print('h', honest)
    dishonest = ret[i][1]
    for a in honest:
        for b in ret[a][1]:
            if b not in dishonest:
                dishonest.append(b)
    # print('d', dishonest)
    dishonest = list(set(dishonest))
    invalid = []
    for j in range(0, n):
        if i == j:
            continue
        val = True
        for k in ret[j][1]:
            if k in honest:
                val = False
        for k in ret[j][0]:
            if k in dishonest:
                val = False
        if not val:
            invalid.append(j)
    # print('invalid', invalid)
    import itertools
    lst = list(itertools.product([0, 1], repeat=n))
    for string in lst:
        string = list(string)
        for j in invalid:
            string[j] = 0
        if list(set(honest) & set(dishonest)) == []:
            # print(string)
            ans = max(ans, string.count(1))
print(ans)

Compiler output:
a.cc:21:7: error: invalid preprocessing directive #print
   21 |     # print('honest_list: ', honest_p)
      |       ^~~~~
a.cc:34:7: error: invalid preprocessing directive #print
   34 |     # print('h', honest)
      |       ^~~~~
a.cc:40:7: error: invalid preprocessing directive #print
   40 |     # print('d', dishonest)
      |       ^~~~~
a.cc:55:7: error: invalid preprocessing directive #print
   55 |     # print('invalid', invalid)
      |       ^~~~~
a.cc:63:15: error: invalid preprocessing directive #print
   63 |             # print(string)
      |               ^~~~~
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
a.cc:3:1: error: expected unqualified-id before 'for'
    3 | for i in range(0, n):
      | ^~~
a.cc:17:1: error: 'def' does not name a type
   17 | def f(honest_p):
      | ^~~
a.cc:33:5: error: 'honest' does not name a type; did you mean 'const'?
   33 |     honest = list(set(f(i)))
      |     ^~~~~~
      |     const
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args)
  {
    
    Scanner input = new Scanner(System.in);
    int t = input.nextInt();
    ArrayList<Integer> honest = new ArrayList<>();
    Arraylist<Integer> dishonest = new ArrayList<>();
    while(t-->0)
    {
      int n = input.nextInt();
      while(n-->0)
      {
        int x = input.nextInt();
        int y = input.nextInt();
        
        if(y==0)
          dishonest.add(x);
       	else
          honest.add(x);
      }
    }
    if(honest.size()==dishonest.size())
      System.out.println(0);
    else if(honest.size()==0)
      System.out.println(1);
    else
      System.out.println(honest.size());
    
    
    
    
  }
}


Compiler output:
Main.java:10: error: cannot find symbol
    Arraylist<Integer> dishonest = new ArrayList<>();
    ^
  symbol:   class Arraylist
  location: class Main
1 error
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args)
  {
    
    Scanner input = new Scanner(System.in);
    int t = input.nextInt();
    ArrayList<Integer> honest = new ArrayList<>();
    Arraylist<Integer> dishonest = new Arraylist<>();
    while(t-->0)
    {
      int n = input.nextInt();
      while(n-->0)
      {
        int x = input.nextInt();
        int y = input.nextInt();
        
        if(y==0)
          dishonest.add(x);
       	else
          honest.add(x);
      }
    }
    if(honest.size()==dishonest.size())
      System.out.println(0);
    else if(honest.size()==0)
      System.out.println(1);
    else
      System.out.println(honest.size());
    
    
    
    
  }
}

Compiler output:
Main.java:10: error: cannot find symbol
    Arraylist<Integer> dishonest = new Arraylist<>();
    ^
  symbol:   class Arraylist
  location: class Main
Main.java:10: error: cannot find symbol
    Arraylist<Integer> dishonest = new Arraylist<>();
                                       ^
  symbol:   class Arraylist
  location: class Main
2 errors
Language: C++

#include<bits/stdc++.h>

using namespace std;


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

int N;
cin >> N;
int A[N],x[N][N],y[N][N];

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

int main(){
	solve();
}




Compiler output:
a.cc: In function 'void solve()':
a.cc:34:51: error: invalid types 'int[int]' for array subscript
   34 |                                 if (((bits >> (x[i[j]-1])) & 1 )^ y[i][j]) ok = false;
      |                                                   ^
Language: C++

#include<bits/stdc++.h>

using namespace std;


int N;
cin >> N;
int A[N],x[N][N],y[N][N];

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

int main(){
	solve();
}




Compiler output:
a.cc:7:1: error: 'cin' does not name a type
    7 | cin >> N;
      | ^~~
a.cc:8:7: error: size of array 'A' is not an integral constant-expression
    8 | int A[N],x[N][N],y[N][N];
      |       ^
a.cc:8:15: error: size of array 'x' is not an integral constant-expression
    8 | int A[N],x[N][N],y[N][N];
      |               ^
a.cc:8:12: error: size of array 'x' is not an integral constant-expression
    8 | int A[N],x[N][N],y[N][N];
      |            ^
a.cc:8:23: error: size of array 'y' is not an integral constant-expression
    8 | int A[N],x[N][N],y[N][N];
      |                       ^
a.cc:8:20: error: size of array 'y' is not an integral constant-expression
    8 | int A[N],x[N][N],y[N][N];
      |                    ^
a.cc: In function 'void solve()':
a.cc:33:51: error: invalid types 'int[int]' for array subscript
   33 |                                 if (((bits >> (x[i[j]-1])) & 1 )^ y[i][j]) ok = false;
      |                                                   ^
Language: C++

import itertools
N = int(input())
As = []
data = []

for i in range(N):
    As.append(int(input()))
    for k in range(As[i]):
      x,y = [int(j) for j in input().split()]
      data.append(x)
      data.append(y)

searched = [False]*N
TF = [-1]*N

#print("len"+str(len(data)))

for i in range(0,int(len(data)),2):
    if searched[data[i]-1]==False:
        searched[data[i]-1] = True
        TF[data[i]-1] = data[i+1]
    else:
        TF[data[i]-1] != data[i+1]
        TF[data[i]-1] = 0
    print(data[i])
    
count = 0
for i in range(int(len(TF))):
    if TF[i]==1:
        count += 1

#print(searched)
#print(TF)
print(count)


Compiler output:
a.cc:16:2: error: invalid preprocessing directive #print
   16 | #print("len"+str(len(data)))
      |  ^~~~~
a.cc:32:2: error: invalid preprocessing directive #print
   32 | #print(searched)
      |  ^~~~~
a.cc:33:2: error: invalid preprocessing directive #print
   33 | #print(TF)
      |  ^~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import itertools
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<bits/stdc++.h>
using namespace std;
int N,a,b,x,y,i,j,k,l,f,X[15][15];
main(){
    for(cin>>N;i<N;++i){
        for(cin>>b,j=0;j<b;++j){
            cin>>x>>y;
            X[i][x-1]=y+1;
        }
    }
    for(;l<1<<N;a=max(a,__builtin_popcount(l)*!f),++l){
        for(f=j=0;j<N;++j){
            for(k=0;k<N;++k)f|=(l>>j)%2*(b=X[j][k])&&(l>>k)%2!=b-1;
    cout<<a;
}

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:15:2: error: expected '}' at end of input
   15 | }
      |  ^
a.cc:11:55: note: to match this '{'
   11 |     for(;l<1<<N;a=max(a,__builtin_popcount(l)*!f),++l){
      |                                                       ^
a.cc:15:2: error: expected '}' at end of input
   15 | }
      |  ^
a.cc:4:7: note: to match this '{'
    4 | main(){
      |       ^
Language: C++

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

int main(){

  int N;
  cin>>N;
  int A[16],x[16][16],y[16][16];
  int hone[16];
  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 all=pow(2,N);
  bool esc=0;
  int cnt=0;
  int MAX=0;
      int decll=all;

  
  for(int i=0;i<all;i++){
    decll--;
    esc=0;cnt=0;
    
    for(int j=0;j<N;j++){
     //         cout<<decll/(int)pow(2,N-j-1)<<endl;

      if((decll/(int)pow(2,N-j-1)) % 2==1){//jさんが正直
        hone[j]=1;
      }
      else if((decll/(int)pow(2,N-j-1)) % 2==0){
        hone[j]=0;
      }
    // cout<<hone[j]<<endl;
    }
    
    for(int j=0;j<N;j++){
      if(hone[j]==1){
      for(int k=0;k<A[j];k++){
        if(hone[x[j][k]-1]!=y[j][k])esc=1;
        if(esc)break;
      }
      if(esc)break;
    }

/*      if(hone[j]==0){
      for(int k=0;k<A[j];k++){
        if(hone[x[j][k]-1]==y[j][k])esc=1;
        if(esc)break;
      }
      if(esc)break;
    }
    }    */
    if(esc)continue;
    else if(!esc){
      for(int j=0;j<N;j++){
        if(hone[j]==1)cnt++;
      }
    }
    MAX=max(MAX,cnt);
  }
  
  cout<<MAX<<endl;
  
  
}

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

n = int(input())
x = []
y = []

for i in range(n):
    a = int(input())
    x.append([])
    y.append([])
    for j in range(a):
        u, v = map(int, input().split())
        x[i].append(u)
        y[i].append(v)
ans = 0
for i in range(2 ** n):
    jdg = [False] * n
    used = [False] * n
    end = False
    for j in range(n):
        if ((i >> j) & 1):
            jdg[j] = True
    for j in range(n):
        for k in range(n):
            if ((not jdg[k]) or used[k]):
                continue
            used[k] = True
            for l in range(len(x[k])):
                if (y[k][l] == 1):
                    jdg[x[k][l] - 1] = True
                elif (jdg[x[k][l] - 1]):
                    end = True
                    break
            if (end):
                break
        if (end):
            break
    if (end):
        continue
    ans = max(sum(jdg), ans)

print(ans)


Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C++


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

Compiler output:
a.cc: In function 'void solve()':
a.cc:15:5: 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 | 
a.cc:31:22: error: 'max' was not declared in this scope
   31 |         if(ok) ans = max(ans, counter(bits));
      |                      ^~~
a.cc:33:5: error: 'cout' was not declared in this scope
   33 |     cout << ans << endl;
      |     ^~~~
a.cc:33:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:33:20: error: 'endl' was not declared in this scope
   33 |     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 |
Language: C


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

Compiler output:
main.c:2:1: error: unknown type name 'using'
    2 | using namespace std;
      | ^~~~~
main.c:2:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    2 | using namespace std;
      |                 ^~~
main.c: In function 'solve':
main.c:15:5: error: 'cin' undeclared (first use in this function)
   15 |     cin >> N;
      |     ^~~
main.c:15:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:24:9: error: unknown type name 'bool'
   24 |         bool ok = true;
      |         ^~~~
main.c:1:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
  +++ |+#include <stdbool.h>
    1 | 
main.c:24:19: error: 'true' undeclared (first use in this function)
   24 |         bool ok = true;
      |                   ^~~~
main.c:24:19: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:28:64: error: 'false' undeclared (first use in this function)
   28 |                 if(((bits >> (x[i][j]-1)) & 1) ^ y[i][j]) ok = false;
      |                                                                ^~~~~
main.c:28:64: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:31:22: error: implicit declaration of function 'max' [-Wimplicit-function-declaration]
   31 |         if(ok) ans = max(ans, counter(bits));
      |                      ^~~
main.c:33:5: error: 'cout' undeclared (first use in this function); did you mean 'counter'?
   33 |     cout << ans << endl;
      |     ^~~~
      |     counter
main.c:33:20: error: 'endl' undeclared (first use in this function)
   33 |     cout << ans << endl;
      |                    ^~~~
Language: C++

#include <cstdio>
#include <climits>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <cstdio>
#include <climits>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <utility>
#include <queue>
#include <cstring>
#define rep(i, n) for (int i = 0; i < int(n); i++)
using namespace std;
long long MOD = 1000000007;
long long INF = 1000000000000000;

typedef long long ll;
typedef unsigned long long ull;

int main(void) {
  int n; cin >> n;
  int loop = 1 << n;

  int a[20];
  int x[20][20], y[20][20];
  rep(i, n) {
    cin >> a[i];
    rep(j, a[i]) {
      cin >> x[i][j] >> y[i][j];
      x[i][j]--;
    }
  }

  int ans = 0;

  rep(i, loop) {
    int flag = 0;
    rep(j, n) {
      int f = ((i >> j) & 1);
      rep(k, a[j]) {
	if (f == 1) {
	  if (((i >> x[j][k]) & 1) != y[j][k]) flag++;
	} 
	if (flag > 0) break;
      }
      if (flag > 0) break;
    }
    if (flag == 0) {
      ll cnt = 0;
      rep(j, n) cnt += (i >> j) & 1;
      ans = max(ans, cnt);
    }
  }

  cout << ans << endl;

  return 0;
}
	


Compiler output:
a.cc: In function 'int main()':
a.cc:56:16: error: no matching function for call to 'max(int&, ll&)'
   56 |       ans = max(ans, cnt);
      |             ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/bits/specfun.h:43,
                 from /usr/include/c++/14/cmath:3906,
                 from a.cc:3:
/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:56:16: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   56 |       ans = max(ans, cnt);
      |             ~~~^~~~~~~~~~
/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,
                 from a.cc:6:
/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:56:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   56 |       ans = max(ans, cnt);
      |             ~~~^~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int t,c =0;
  cin >> t;
  while(t--)
  {
    int n;
    cin >> n;
    for(int i=0;i<n;i+++)
    {
      int a,b;
      cin >> a >> b;
      if(b == 1)
      {
        c++;
      }
    }      
  }
  cout << c;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: expected primary-expression before ')' token
   11 |     for(int i=0;i<n;i+++)
      |                         ^
Language: C++

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

int main() {

	int N = 0;
	cin >> N;

	vector<vector<int>> val(N, vector<int>(N));

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

	int x = 0;
	int y = 0;

	int A = 0;

	for (int i = 0; i < N; i++) {
		cin >> A;
		for (int j = 0; j < A; j++) {
			cin >> x;
			cin >> y;
			x -= 1;

			val[i][x] = y;
		}
	}

	vector<int> ans;
	bool jdg = false;
	int dum = 0;
	int num = 0;

	for (int k = 0; k < pow(2, N); k++) {
		num = k;
		for (int l = N - 1; l >= 0; l--) {
			val[l][l] = num / pow(2, l);
			num = num - val[l][l] * pow(2, l);
		}
		dum = 0;
		for (int i = 0; i < N; i++) {
			for (int j = 0; j < N; j++) {
				if (i != j && val[i][j] >= 0 && (val[i][j] ^ val[i][i]) == val[j][j]) {
					dum += 1;
				}
				if (i != j && val[j][i] >= 0 && (val[j][i] ^ val[j][j]) == val[i][i]) {
					dum += 1;
				}
			}
		}
		if (dum == 0) {
			int sum = 0;
			for (int i = 0; i < N; i++) {
				sum += val[i][i];
			}
			ans.push_back(sum);
		}
	}
	int ansval = 0;
	if (ans.size() != 0) {
		ansval = N - *min_element(ans.begin(), ans.end());
	}
	else {
		ansval = 0;
	}
	
	cout << ansval << endl;

	return 0;
}




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

#include<bits/stdc++.h>
using namespace std;
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define SZ(x) ((int)(x).size())
#define debug(x) cerr << #x << ": " << x << '\n'
#define INF 999999999
typedef long long int Int;
typedef pair<int,int> P;
using ll = long long;
using VI = vector<int>;
const int N = 15;
vector< pair< int,int > > A[N];
int main(){
    int n,ans = 0;
    cin >> n;
    rep(i,n){
        int a,x,y;
        cin >> a;
        rep(j,a){
            cin >> x >> y;
            x--,A[i].push_back({x,y});
        }
    }
    for(int i=1;i<(1<<n);i++){
        int ch = 0;
        for(int j=0;j<n;j++){
            if(!(1<<j)&i)) continue;
            for(auto &x:A[j]){
                int state = ((1<<x.first)&i)?1:0;
                ch |= state!= x.second;
            }
            if(!ch) ans = max(ans,__builtin_popcount(i));
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:26: error: expected primary-expression before ')' token
   29 |             if(!(1<<j)&i)) continue;
      |                          ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define SZ(x) ((int)(x).size())
#define debug(x) cerr << #x << ": " << x << '\n'
#define INF 999999999
typedef long long int Int;
typedef pair<int,int> P;
using ll = long long;
using VI = vector<int>;
const int N = 15;
vector< pair< int,int > > A[N];
int main(){
    int n,ans = 0;
    cin >> n;
    rep(i,n){
        int a,x,y;
        cin >> a;
        rep(j,a){
            cin >> x >> y;
            x--,A[i].push_back({x,y});
        }
    }
    for(int i=1;i<(1<<n);i++){
        int ch = 0;
        for(int j=0;j<n;j++){
            for(auto &x:a[j]){
                int state = ((1<<x.first)&i)?1:0;
                ch |= state!= x.second;
            }
            if(!ch) ans = max(ans,__builtin_popcount(i));
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:25: error: 'a' was not declared in this scope
   29 |             for(auto &x:a[j]){
      |                         ^
Language: C

#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
int acs(const void *a, const void *b){return *(int*)a - *(int*)b;} /* 1,2,3,4.. */
int des(const void *a, const void *b){return *(int*)b - *(int*)a;} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b){return *(char*)a - *(char*)b;} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b){return strcmp(*(const char **)a, *(const char **)b);} /* aaa,aab.. */
#define min(a,b) (a < b ? a: b)
#define max(a,b) (a > b ? a: b)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define MAX 100001
#define MOD 1000000007

typedef long long int lli;

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

int main(void) {
  int n;
  int xy[16][16][2] = {0};
  int a[16];
  scanf("%d", &n);
  rep(i, 0, n) {
    scanf("%d", &a[i]);
    rep(j, 0, a[i]) {
      scanf("%d %d", &xy[i][j][0], & xy[i][j][1]);
    }
  }
  
  // bit探索
  int ans = 0;
  for (int t = 0; t < (1 << n); t++) {　// 状態をbitで表現
    int ok = 1;
    for (int p = 0; p < n; p++) {
      if (t & (1 << p) == 0) continue;
      for (int i = 0; i < a[p]; i++) {
        if (((1 << (xy[p][i][0] - 1)) & t) != xy[p][i][1]) 
          ok = 0;
      }
    }
    if (ok) ans = max(ans, counter(t));
  }
  printf("%d\n", ans);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:39:39: error: stray '\343' in program
   39 |   for (int t = 0; t < (1 << n); t++) {<U+3000>// <U+72B6><U+614B><U+3092>bit<U+3067><U+8868><U+73FE>
      |                                       ^~~~~~~~
Language: C++

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

signed main() {
  int N;
  cin >> N;
  
  vector<vector<int>> hito(N, vector<int>(N));
  for( int i = 0; i < N; i++ ){
    for( int j = 0; j < N; j++ ){
      hito.at(i).at(j) = -1;
    }
  }
  
  int A, X, Y;
  for( int i = 0; i < N; i++ ){
    cin >> A;
    for( int j = 0; j < A; j++ ){
      cin >> X >> Y;
      hito.at(i).at(X-1) = Y;
    }
  }
  
  int ans = 0;
  for (int bit = 0; bit < (1<<N); ++bit){
    int cnt = 0;
    for (int i = 0; i < N; ++i) {
      if (bit & (1<<i)) { // i が bit に入るかどうか
        bool fg = true;
        for( int j  = 0; j < N; j++ ){
          if( hito.at(i).at(j) == 1 && hito.at(j).at(i) == 0 ) fg = false;
          if (bit & (1<<j)){
            if( hito.at(i).at(j) == 0 ) fg = false;
            if( hito.at(j).at(i) == 0 ) fg = false;
          }
          else{
            if( hito.at(i).at(j) == 1 ) fg = false;
            if( hito.at(j).at(i) == 1 ) fg = false;
          }
        }
        if( fg == true ) cnt++;
      }
    }
    if(fg == true) ans = max( ans, cnt );
  }
  cout << ans << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:8: error: 'fg' was not declared in this scope
   45 |     if(fg == true) ans = max( ans, cnt );
      |        ^~
Language: C++

#include <bits/stdc++.h>

using namespace std;
#define int long long
bool kind(int j, int i) {
    return (1 << j) & i;
}

signed main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int N;
    cin >> N;
    vector<vector<pair<int, int>>> p(N, vector<pair<int, int>>());
    for (int i = 0; i < N; i++) {
        int a;
        cin >> a;
        for (int j = 0; j < a; j++) {
            int x, y;
            cin >> x >> y;
            x--;
            p[i].push_back({x, y});
        }
    }
    int max = 0;
    for (int i = 0; i < (1 << N); i++) { // 正直ものかどうかの組み合わせのループ
        int count = 0;
        bool ok = true;
        for (int j = 0; j < N; j++) { // それぞれの人についてのループ
            if (!kind(j,i)) {
                continue
            }
            for (auto& q : p[j]) { // それぞれの証言についてのループ
                if (kind(q.first, i) != q.second) {
                    // conflict!!
                    ok = false;
                    break;
                }
            }
            if (!ok) { // 矛盾があったらbreak
                break;
            }
        }
        // 矛盾がないので最大値を交信
        if (ok) {
            max = std::max(max, count);
        }
    }
    cout << max << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:25: error: expected ';' before '}' token
   30 |                 continue
      |                         ^
      |                         ;
   31 |             }
      |             ~
Language: C++

N = int(input())
xyss = []
for i in range(N):
    A = int(input())
    xys = []
    for j in range(A):
        x, y = map(int, input().split())
        xys.append((x-1, y))
    xyss.append(xys)
 
ans = 0
for S in range(2**N):
    numHonest = 0
    isOK = True
    for i in range(N):
        if (S>>i)&1 == 0:
            continue
 
        numHonest += 1
        xys = xyss[i]
        A = len(xys)
        for x, y in xys:  # 証言j
            if (S>>x)&1 != y:
                isOK = False
                break
        if not isOK:
            break
 
    if isOK:
        ans = max(ans, numHonest)
 
print(ans)

Compiler output:
a.cc:22:27: error: stray '#' in program
   22 |         for x, y in xys:  # 証言j
      |                           ^
a.cc:1:1: error: 'N' does not name a type
    1 | N = int(input())
      | ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
using vl = vector<ll>;
using vvl = vector<vl>;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
using ll = long long;
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}

ll modpow(ll a, ll p) {
    if(p == 0)
        return 1;
    if(p % 2 == 0) {
        ll halfp = p / 2;
        ll half = modpow(a, halfp);
        return half * half % MOD;
    } else {
        return a * modpow(a, p - 1) % MOD;
    }
}

long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while(b) {
        long long t = a / b;
        a -= t * b;
        swap(a, b);
        u -= t * v;
        swap(u, v);
    }
    u %= m;
    if(u < 0)
        u += m;
    return u;
}

int main() {
    ll N;
    cin >> N;
    vector<ll> A(N);

    REP(i, N) {
        cin >> A[i];
        REP(j, 61) {
            if(!(A[i] & (1LL << j))) {
                cnt[j]++;
            }
        }
    };
    ll ans = 0LL;
    REP(i, N) {
        REP(j, 61) {
            if(A[i] & (1LL << j)) {
                // flagが立っていたら
                // cout << i << " hoge" << j << ":" << cnt[j] << endl;
                // 1 0
                ans += modpow(2LL, j) * cnt[j];
            } else {
                // 0 1
                ans += modpow(2LL, j) * (N - cnt[j]);
            }
            ans %= MOD;
        }
        ans %= MOD;
    }
    cout << ans * modinv(2, MOD) << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:72:17: error: 'cnt' was not declared in this scope; did you mean 'int'?
   72 |                 cnt[j]++;
      |                 ^~~
      |                 int
a.cc:83:41: error: 'cnt' was not declared in this scope; did you mean 'int'?
   83 |                 ans += modpow(2LL, j) * cnt[j];
      |                                         ^~~
      |                                         int
a.cc:86:46: error: 'cnt' was not declared in this scope; did you mean 'int'?
   86 |                 ans += modpow(2LL, j) * (N - cnt[j]);
      |                                              ^~~
      |                                              int
Language: C++

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

#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
// #define int long long
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) int(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using ul = unsigned long;

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

int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { return a * b / GCD(a, b); }

const int dy[] = {0, 1, 0, -1, -1, 1, 1, -1};
const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};

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

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];
    rep(j,a[i]){
      cin>>x[i][j]>>y[i][j];
    }
  }
  int ans=0;
  for(int bits=1; bits<(1<<n); bits++){
    bool ok=true;
    for(int i=1; i<=n; i++){
      if(!(bits & (1<<(i-1)))) continue;
      for(int j=1; j<=a[i]; j++){
        if(((bits>>x[i][j]-1)&1) ^ y[i][j]) ok = false;
      }
    }
    if(ok) chmax(ans, couter(bits));
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:75:23: error: 'couter' was not declared in this scope; did you mean 'counter'?
   75 |     if(ok) chmax(ans, couter(bits));
      |                       ^~~~~~
      |                       counter
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:49:14: error: no matching function for call to 'min(long long int&, long long unsigned int)'
   49 |       ans=min(ans,N-B.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:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:49:14: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long long unsigned int')
   49 |       ans=min(ans,N-B.count());
      |           ~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281: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:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:49:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   49 |       ans=min(ans,N-B.count());
      |           ~~~^~~~~~~~~~~~~~~~~