Language: C++

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

using ll = long long;
using ull = unsigned long long;
using st = string;
using db = double;
using vll = vector<long long>;
using vdb = vector<db>;
using vvll = vector<vll>;
using vst = vector<st>;
using vchar = vector<char>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;
using vvpll = vector<vpll>;
#define rep(i, m, n) for (ll i = (ll)(m); i < (ll)(n); i++)
#define vrep(i, vec) for(auto& i : vec)
#define vin(vec) for(auto& i : vec) cin >> i
#define all(v) v.begin(), v.end()
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;}
const ll mod = 1000000007;
const ll inf = 1LL << 60;


int main(){
  ll n;
  cin >> n;
  vvpll a(n);
  vrep(i, a){
    ll ai;
    cin >> ai;
    rep(j, 0, ai){
      ll x, y;
      cin >> x >> y;
      x--;
      i.push_back(make_pair(x, y));
    }
  }

  ll ans = 0;
  rep(bit, 0, 1<<n){
    bool check = true;
    rep(i, 0, n) if(bit>>i) vrep(j, a.at(i)){
      if(j.second == 0 && bit>>j.first) check = false;
      if(j.second == 1 && !(bit>>j.first)) check = false;
    }
    if(check){
      ll tr = 0;
      rep(j, 0, n)if(1<<j & bit) tr++;
      chmax(ans, tr);
    }
  }
  cout << ans << endl;
}#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using ull = unsigned long long;
using st = string;
using db = double;
using vll = vector<long long>;
using vdb = vector<db>;
using vvll = vector<vll>;
using vst = vector<st>;
using vchar = vector<char>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;
using vvpll = vector<vpll>;
#define rep(i, m, n) for (ll i = (ll)(m); i < (ll)(n); i++)
#define vrep(i, vec) for(auto& i : vec)
#define vin(vec) for(auto& i : vec) cin >> i
#define all(v) v.begin(), v.end()
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;}
const ll mod = 1000000007;
const ll inf = 1LL << 60;


int main(){
  ll n;
  cin >> n;
  vvpll a(n);
  vrep(i, a){
    ll ai;
    cin >> ai;
    rep(j, 0, ai){
      ll x, y;
      cin >> x >> y;
      x--;
      i.push_back(make_pair(x, y));
    }
  }

  ll ans = 0;
  rep(bit, 0, 1<<n){
    bool check = true;
    rep(i, 0, n) if(bit>>i) vrep(j, a.at(i)){
      if(j.second == 0 && bit>>j.first) check = false;
      if(j.second == 1 && !(bit>>j.first)) check = false;
    }
    if(check){
      ll tr = 0;
      rep(j, 0, n)if(1<<j & bit) tr++;
      chmax(ans, tr);
    }
  }
  cout << ans << endl;
}#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using ull = unsigned long long;
using st = string;
using db = double;
using vll = vector<long long>;
using vdb = vector<db>;
using vvll = vector<vll>;
using vst = vector<st>;
using vchar = vector<char>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;
using vvpll = vector<vpll>;
#define rep(i, m, n) for (ll i = (ll)(m); i < (ll)(n); i++)
#define vrep(i, vec) for(auto& i : vec)
#define vin(vec) for(auto& i : vec) cin >> i
#define all(v) v.begin(), v.end()
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;}
const ll mod = 1000000007;
const ll inf = 1LL << 60;


int main(){
  ll n;
  cin >> n;
  vvpll a(n);
  vrep(i, a){
    ll ai;
    cin >> ai;
    rep(j, 0, ai){
      ll x, y;
      cin >> x >> y;
      x--;
      i.push_back(make_pair(x, y));
    }
  }

  ll ans = 0;
  rep(bit, 0, 1<<n){
    bool check = true;
    rep(i, 0, n) if(bit>>i) vrep(j, a.at(i)){
      if(j.second == 0 && bit>>j.first) check = false;
      if(j.second == 1 && !(bit>>j.first)) check = false;
    }
    if(check){
      ll tr = 0;
      rep(j, 0, n)if(1<<j & bit) tr++;
      chmax(ans, tr);
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc:55:2: error: stray '#' in program
   55 | }#include <bits/stdc++.h>
      |  ^
a.cc:109:2: error: stray '#' in program
  109 | }#include <bits/stdc++.h>
      |  ^
a.cc:55:3: error: 'include' does not name a type
   55 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:74:31: error: redefinition of 'template<class T> bool chmin(T&, T)'
   74 | template<class T> inline bool chmin(T& a, T b){if(a > b){a = b;return true;} return false;}
      |                               ^~~~~
a.cc:20:31: note: 'template<class T> bool chmin(T&, T)' previously declared here
   20 | template<class T> inline bool chmin(T& a, T b){if(a > b){a = b;return true;} return false;}
      |                               ^~~~~
a.cc:75:31: error: redefinition of 'template<class T> bool chmax(T&, T)'
   75 | template<class T> inline bool chmax(T& a, T b){if(a < b){a = b;return true;} return false;}
      |                               ^~~~~
a.cc:21:31: note: 'template<class T> bool chmax(T&, T)' previously declared here
   21 | template<class T> inline bool chmax(T& a, T b){if(a < b){a = b;return true;} return false;}
      |                               ^~~~~
a.cc:76:10: error: redefinition of 'const ll mod'
   76 | const ll mod = 1000000007;
      |          ^~~
a.cc:22:10: note: 'const ll mod' previously defined here
   22 | const ll mod = 1000000007;
      |          ^~~
a.cc:77:10: error: redefinition of 'const ll inf'
   77 | const ll inf = 1LL << 60;
      |          ^~~
a.cc:23:10: note: 'const ll inf' previously defined here
   23 | const ll inf = 1LL << 60;
      |          ^~~
a.cc:80:5: error: redefinition of 'int main()'
   80 | int main(){
      |     ^~~~
a.cc:26:5: note: 'int main()' previously defined here
   26 | int main(){
      |     ^~~~
a.cc:109:3: error: 'include' does not name a type
  109 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:128:31: error: redefinition of 'template<class T> bool chmin(T&, T)'
  128 | template<class T> inline bool chmin(T& a, T b){if(a > b){a = b;return true;} return false;}
      |                               ^~~~~
a.cc:20:31: note: 'template<class T> bool chmin(T&, T)' previously declared here
   20 | template<class T> inline bool chmin(T& a, T b){if(a > b){a = b;return true;} return false;}
      |                               ^~~~~
a.cc:129:31: error: redefinition of 'template<class T> bool chmax(T&, T)'
  129 | template<class T> inline bool chmax(T& a, T b){if(a < b){a = b;return true;} return false;}
      |                               ^~~~~
a.cc:21:31: note: 'template<class T> bool chmax(T&, T)' previously declared here
   21 | template<class T> inline bool chmax(T& a, T b){if(a < b){a = b;return true;} return false;}
      |                               ^~~~~
a.cc:130:10: error: redefinition of 'const ll mod'
  130 | const ll mod = 1000000007;
      |          ^~~
a.cc:22:10: note: 'const ll mod' previously defined here
   22 | const ll mod = 1000000007;
      |          ^~~
a.cc:131:10: error: redefinition of 'const ll inf'
  131 | const ll inf = 1LL << 60;
      |          ^~~
a.cc:23:10: note: 'const ll inf' previously defined here
   23 | const ll inf = 1LL << 60;
      |          ^~~
a.cc:134:5: error: redefinition of 'int main()'
  134 | int main(){
      |     ^~~~
a.cc:26:5: note: 'int main()' previously defined here
   26 | int main(){
      |     ^~~~