Language: C++

#include <iostream>
#include <cmath>
#include <stdint.h>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <string.h>
#include <set>
using namespace std;
 
#define int long long
 
 
int gcd(int a, int b){
	
	if(b==0){
		return a;
	}
	
	return gcd(b,a%b);
	
}
 
 int lcm(int a, int b)  
 {  
    return (a*b)/gcd(a, b);  
 }  
 
 
int f(int x){
	
	
	int res = 0;
	
	while( x%2 == 0){
		
		x/=2;
		res++;
	}
	
	return res;
	
}
int g[16][16];
 
int32_t main() {
 	memset(g,-1,sizeof(g));
 	int n;
 	
 	cin >> n;
 	int cnt =0;
 	for(int i=1; i<=n; i++){
 		
 		int m;
 		cin >> m;
 	 
 		for(int j=1; j<=m; j++){	
		 	int x, y;		 
			cin >> x >> y;			
		 	g[i][x] = y;
		}
 		
	 }
 
 	 int ans =0 ;
	  
	  for(int i=0; i< 1<<n; i++ ){
	  	
	  	vector<int> d(n);
	  	
	  	for(int  j=0; j<n; j++){
	  		int f = 1 << j;
		  if(i & f){
		  	d[j] = 1;
		  }	
	  		
		}
	  	
	  	book ok =true;
	  	for(int j=0; j<n; j++){
	  		
	  		if(d[j]){
	  			
	  			for(int k=0; k<n; k++){
	  			
				  	if(g[j][k] == -1)
				  		continue;
	  				if(g[j][k] != d[k])
	  					ok = false;
				}
	  			
			}
		  	
		  	if(ok)
		  		ans = max(ans, __builtin_popcount(i));
		  	
		}
	  	
	  	
	  	cout << ans << endl;
	  } 
 	 
 	 
 	  
 	  
}
 
 
 

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:81:17: error: 'book' was not declared in this scope; did you mean 'bool'?
   81 |                 book ok =true;
      |                 ^~~~
      |                 bool
a.cc:91:49: error: 'ok' was not declared in this scope; did you mean 'k'?
   91 |                                                 ok = false;
      |                                                 ^~
      |                                                 k
a.cc:96:28: error: 'ok' was not declared in this scope
   96 |                         if(ok)
      |                            ^~
a.cc:97:42: error: no matching function for call to 'max(long long int&, int)'
   97 |                                 ans = max(ans, __builtin_popcount(i));
      |                                       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 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:97:42: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   97 |                                 ans = max(ans, __builtin_popcount(i));
      |                                       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 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:97:42: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   97 |                                 ans = max(ans, __builtin_popcount(i));
      |                                       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~