Language: C++

#include <bits/stdc++.h>
using namespace std;
 
#define maxn -20000000000 //negative value to break code and force you to put right constraint
#define mod 1073741824
#define md(x) (x) % mod;
#define sc scanf
#define pr printf
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ps push
#define prt(x) cout << (#x) << " is " << (x) << endl
#define EPS 1e-9
#define INF 100000000000
#define INFd 1e9
typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<ll> vll;
typedef vector<double> vd;
 
 
 
int main()
{
	ll n;
	cin>>n;
	ll ans=0;
	vector<vector<pair<ll, ll> > > adj(n);
	for(ll i=0;i<n;i++)
	{
		ll a;
		cin>>a;
		for(ll j=0;j<a;j++)
		{
			ll x,y;
			cin>>x>>y;
			x-=1;
			adj[i].pb(mp(x,y));
		}
	}
	for(ll i=0;i<(1<<n);i++)
	{
		//cout<<"i"<<" "<<i<<endl;
		vector<ll> v1(n,0);
		std::vector<ll> v;
		ll j=i;
		while(j>0)
		{
			v.pb(j%2);
			j=j/2;
		}
		reverse(v.begin(),v.end());
		int flag=1;
		int cnt=0;
		for(ll k=0;k<v.size();k++)
		{
			//cout<<k<<" "<<v[k]<<endl;
			
			if(v[k])
			{
				for(ll z=0;z<adj[k].size();z++)
				{
					ll x,y;
					x=adj[k][z].fi;
					y=adj[k][z].se;
					if(y==1&&v[x]==0)
					{
						flag=0;
					}
					else if(y==0&&v[x]==1)
					{
						flag=0;
					}
					//cout<<i<<" "<<x<<" "<<y<<" "<<k<<endl;
				}
				cnt++;
			}
		}
		if(flag)
		ans=max(ans,cnt);
 
	}
	cout<<ans;
}

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