Language: C++

#include<bits/stdc++.h>
using namespace std;
int N;
vector<vector<pair<int,int>>> data;
bool judge(int bit){
  for(int i=0;i<N;i++){
    if(!(bit&(1<<i)))continue;
    for(auto v:data[i]){
      int x=v.first;
      int y=v.second;
      if(y==1&&!(bit&(1<<x)))return false;
      if(y==0&&(bit&(1<<x)))return false;
    }
  }
  return true;
}
int main(){
  cin>>N;
  data.resize(N);
  for(int i=0;i<N;i++){
    int num;
    cin>>num;
    for(int j=0;j<num;j++){
       int x,y;
       cin>>x>>y;
       x--;
       data[i].push_back(make_pair(x,y));
     // cin>>data[i][j].first>>data[i][j].second;
    }
  }
  int ans=0;
  for(int bit=0;bit<(1<<N);bit++){
    int cnt=0;
    if(judge(bit)){
      for(int i=0;i<N;i++){
        if(bit&(1<<i))cnt++;
      }
      ans=max(ans,cnt);
    }
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'bool judge(int)':
a.cc:8:16: error: reference to 'data' is ambiguous
    8 |     for(auto v:data[i]){
      |                ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:4:31: note:                 'std::vector<std::vector<std::pair<int, int> > > data'
    4 | vector<vector<pair<int,int>>> data;
      |                               ^~~~
a.cc: In function 'int main()':
a.cc:19:3: error: reference to 'data' is ambiguous
   19 |   data.resize(N);
      |   ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:4:31: note:                 'std::vector<std::vector<std::pair<int, int> > > data'
    4 | vector<vector<pair<int,int>>> data;
      |                               ^~~~
a.cc:27:8: error: reference to 'data' is ambiguous
   27 |        data[i].push_back(make_pair(x,y));
      |        ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:4:31: note:                 'std::vector<std::vector<std::pair<int, int> > > data'
    4 | vector<vector<pair<int,int>>> data;
      |                               ^~~~