Language: C++

#include <bits/stdc++.h>
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define sz(x) int((x).size())
#define debug(x) cout << #x << ":" << x << ' ';
#define debugg(x) cout << #x << ":" << x << ' ' << "\n";
#define endl '\n'
#define ff first
#define ss second
#define L(X) ((X)<<1)
#define R(X) (((X)<<1)|1)
#define M(X,Y) (((X)+(Y))>>1)

using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int MAXN = 20;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const long long int LLINF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-9;
const double PI = acos(-1);

template<typename T>   T max_self(T& a, T b) { if (a < b) a = b; return a; }
template<typename T>   T min_self(T& a, T b) { if (a > b) a = b; return a; }
template<typename T>   T add(T x, T y) { return ((x % MOD)  + (y % MOD)) % MOD;}
template<typename T>   T mul(T x, T y) { return ((x % MOD) * (long long)(y % MOD)) % MOD;}
template<typename T>   T sub(T x, T y) { return add(x, -y + MOD);}
template<typename T>   T gcd(T a, T b) { return b ? gcd(b, a % b) : a;}
template<typename T>   T lcm(T a, T b) { return a / gcd(a, b) * b;}
template<typename T>   vector<T> read(vector<T>& v, int n) {v.resize(n); for (auto &x : v) cin >> x;}
template<typename T>   void trav(vector<T> &v) {for (int i = 0 ; i < (int)v.size() ; ++i) {cout << v[i]; if (i != (int)v.size() - 1) cout << ' ';}}
int lg2(long long x)   {   return 64 - __builtin_clzll(x) - 1;	}
int lg2(int x)   {   return 32 - __builtin_clzll(x) - 1;	}

struct pair_hash{
	template<class T1, class T2>
	size_t operator() (const pair<T1, T2> &p) const {
		auto h1 = hash<T1>{}(p.first);
		auto h2 = hash<T2>{}(p.second);
		return h1 ^ h2;
	}
};

int fast_mod(int x, int m = MOD) {
	while(x <= m) x -= m;
	if(x < 0) x += m;
	return x;
}

int mod_add(int x, int y) {
	return fast_mod(x + y);
}

map<int, int> mask[MAXN];
bool liar[MAXN];

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int n;
	cin >> n;

	for(int i = 1, k ; i <= n ; ++i) {
		cin >> k;

		for(int j = 0, x, y; j < k ; ++j) {
			cin >> x >> y;
			if(mask[i][x]) liar[i] = true;
			mask[i][x] = (y == 1 ? 1 : -1);
		}

	}

	int ans = 0;

	for(int i = 1 ; i <= n ; ++i) {
		if(liar[i]) continue;
		int cnt = 0;

		for(int j = 1 ; j <= n ; ++j) {
			if(i == j || liar[j]) continue;

			int tmp = 0;

			for(int k = 1 ; k <= n ; ++k) {
				tmp += (mask[i][k] && mask[j][k] && mask[i][k] != mask[j][k]);
			}

			if(!tmp) ++cnt;

		}

		ans = max(ans, cnt);
	}

	cout << ans << endl;

	return 0;
}#include <bits/stdc++.h>
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define sz(x) int((x).size())
#define debug(x) cout << #x << ":" << x << ' ';
#define debugg(x) cout << #x << ":" << x << ' ' << "\n";
#define endl '\n'
#define ff first
#define ss second
#define L(X) ((X)<<1)
#define R(X) (((X)<<1)|1)
#define M(X,Y) (((X)+(Y))>>1)

using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int MAXN = 20;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const long long int LLINF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-9;
const double PI = acos(-1);

template<typename T>   T max_self(T& a, T b) { if (a < b) a = b; return a; }
template<typename T>   T min_self(T& a, T b) { if (a > b) a = b; return a; }
template<typename T>   T add(T x, T y) { return ((x % MOD)  + (y % MOD)) % MOD;}
template<typename T>   T mul(T x, T y) { return ((x % MOD) * (long long)(y % MOD)) % MOD;}
template<typename T>   T sub(T x, T y) { return add(x, -y + MOD);}
template<typename T>   T gcd(T a, T b) { return b ? gcd(b, a % b) : a;}
template<typename T>   T lcm(T a, T b) { return a / gcd(a, b) * b;}
template<typename T>   vector<T> read(vector<T>& v, int n) {v.resize(n); for (auto &x : v) cin >> x;}
template<typename T>   void trav(vector<T> &v) {for (int i = 0 ; i < (int)v.size() ; ++i) {cout << v[i]; if (i != (int)v.size() - 1) cout << ' ';}}
int lg2(long long x)   {   return 64 - __builtin_clzll(x) - 1;	}
int lg2(int x)   {   return 32 - __builtin_clzll(x) - 1;	}

struct pair_hash{
	template<class T1, class T2>
	size_t operator() (const pair<T1, T2> &p) const {
		auto h1 = hash<T1>{}(p.first);
		auto h2 = hash<T2>{}(p.second);
		return h1 ^ h2;
	}
};

int fast_mod(int x, int m = MOD) {
	while(x <= m) x -= m;
	if(x < 0) x += m;
	return x;
}

int mod_add(int x, int y) {
	return fast_mod(x + y);
}

map<int, int> mask[MAXN];
bool liar[MAXN];

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int n;
	cin >> n;

	for(int i = 1, k ; i <= n ; ++i) {
		cin >> k;

		for(int j = 0, x, y; j < k ; ++j) {
			cin >> x >> y;
			if(mask[i][x]) liar[i] = true;
			mask[i][x] = (y == 1 ? 1 : -1);
		}

	}

	int ans = 0;

	for(int i = 1 ; i <= n ; ++i) {
		if(liar[i]) continue;
		int cnt = 0;

		for(int j = 1 ; j <= n ; ++j) {
			if(i == j || liar[j]) continue;

			int tmp = 0;

			for(int k = 1 ; k <= n ; ++k) {
				tmp += (mask[i][k] && mask[j][k] && mask[i][k] != mask[j][k]);
			}

			if(!tmp) ++cnt;

		}

		ans = max(ans, cnt);
	}

	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc:108:2: error: stray '#' in program
  108 | }#include <bits/stdc++.h>
      |  ^
a.cc:108:3: error: 'include' does not name a type
  108 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:130:11: error: redefinition of 'const int MAXN'
  130 | const int MAXN = 20;
      |           ^~~~
a.cc:23:11: note: 'const int MAXN' previously defined here
   23 | const int MAXN = 20;
      |           ^~~~
a.cc:131:11: error: redefinition of 'const int MOD'
  131 | const int MOD = 1e9 + 7;
      |           ^~~
a.cc:24:11: note: 'const int MOD' previously defined here
   24 | const int MOD = 1e9 + 7;
      |           ^~~
a.cc:132:11: error: redefinition of 'const int INF'
  132 | const int INF = 0x3f3f3f3f;
      |           ^~~
a.cc:25:11: note: 'const int INF' previously defined here
   25 | const int INF = 0x3f3f3f3f;
      |           ^~~
a.cc:133:21: error: redefinition of 'const long long int LLINF'
  133 | const long long int LLINF = 0x3f3f3f3f3f3f3f3f;
      |                     ^~~~~
a.cc:26:21: note: 'const long long int LLINF' previously defined here
   26 | const long long int LLINF = 0x3f3f3f3f3f3f3f3f;
      |                     ^~~~~
a.cc:134:14: error: redefinition of 'const double EPS'
  134 | const double EPS = 1e-9;
      |              ^~~
a.cc:27:14: note: 'const double EPS' previously defined here
   27 | const double EPS = 1e-9;
      |              ^~~
a.cc:135:14: error: redefinition of 'const double PI'
  135 | const double PI = acos(-1);
      |              ^~
a.cc:28:14: note: 'const double PI' previously defined here
   28 | const double PI = acos(-1);
      |              ^~
a.cc:137:26: error: redefinition of 'template<class T> T max_self(T&, T)'
  137 | template<typename T>   T max_self(T& a, T b) { if (a < b) a = b; return a; }
      |                          ^~~~~~~~
a.cc:30:26: note: 'template<class T> T max_self(T&, T)' previously declared here
   30 | template<typename T>   T max_self(T& a, T b) { if (a < b) a = b; return a; }
      |                          ^~~~~~~~
a.cc:138:26: error: redefinition of 'template<class T> T min_self(T&, T)'
  138 | template<typename T>   T min_self(T& a, T b) { if (a > b) a = b; return a; }
      |                          ^~~~~~~~
a.cc:31:26: note: 'template<class T> T min_self(T&, T)' previously declared here
   31 | template<typename T>   T min_self(T& a, T b) { if (a > b) a = b; return a; }
      |                          ^~~~~~~~
a.cc:139:26: error: redefinition of 'template<class T> T add(T, T)'
  139 | template<typename T>   T add(T x, T y) { return ((x % MOD)  + (y % MOD)) % MOD;}
      |                          ^~~
a.cc:32:26: note: 'template<class T> T add(T, T)' previously declared here
   32 | template<typename T>   T add(T x, T y) { return ((x % MOD)  + (y % MOD)) % MOD;}
      |                          ^~~
a.cc:140:26: error: redefinition of 'template<class T> T mul(T, T)'
  140 | template<typename T>   T mul(T x, T y) { return ((x % MOD) * (long long)(y % MOD)) % MOD;}
      |                          ^~~
a.cc:33:26: note: 'template<class T> T mul(T, T)' previously declared here
   33 | template<typename T>   T mul(T x, T y) { return ((x % MOD) * (long long)(y % MOD)) % MOD;}
      |                          ^~~
a.cc:141:26: error: redefinition of 'template<class T> T sub(T, T)'
  141 | template<typename T>   T sub(T x, T y) { return add(x, -y + MOD);}
      |                          ^~~
a.cc:34:26: note: 'template<class T> T sub(T, T)' previously declared here
   34 | template<typename T>   T sub(T x, T y) { return add(x, -y + MOD);}
      |                          ^~~
a.cc:142:26: error: redefinition of 'template<class T> T gcd(T, T)'
  142 | template<typename T>   T gcd(T a, T b) { return b ? gcd(b, a % b) : a;}
      |                          ^~~
a.cc:35:26: note: 'template<class T> T gcd(T, T)' previously declared here
   35 | template<typename T>   T gcd(T a, T b) { return b ? gcd(b, a % b) : a;}
      |                          ^~~
a.cc:143:26: error: redefinition of 'template<class T> T lcm(T, T)'
  143 | template<typename T>   T lcm(T a, T b) { return a / gcd(a, b) * b;}
      |                          ^~~
a.cc:36:26: note: 'template<class T> T lcm(T, T)' previously declared here
   36 | template<typename T>   T lcm(T a, T b) { return a / gcd(a, b) * b;}
      |                          ^~~
a.cc:144:34: error: redefinition of 'template<class T> std::vector<_Tp> read(std::vector<_Tp>&, int)'
  144 | template<typename T>   vector<T> read(vector<T>& v, int n) {v.resize(n); for (auto &x : v) cin >> x;}
      |                                  ^~~~
a.cc:37:34: note: 'template<class T> std::vector<_Tp> read(std::vector<_Tp>&, int)' previously declared here
   37 | template<typename T>   vector<T> read(vector<T>& v, int n) {v.resize(n); for (auto &x : v) cin >> x;}
      |                                  ^~~~
a.cc:145:29: error: redefinition of 'template<class T> void trav(std::vector<_Tp>&)'
  145 | template<typename T>   void trav(vector<T> &v) {for (int i = 0 ; i < (int)v.size() ; ++i) {cout << v[i]; if (i != (int)v.size() - 1) cout << ' ';}}
      |                             ^~~~
a.cc:38:29: note: 'template<class T> void trav(std::vector<_Tp>&)' previously declared here
   38 | template<typename T>   void trav(vector<T> &v) {for (int i = 0 ; i < (int)v.size() ; ++i) {cout << v[i]; if (i != (int)v.size() - 1) cout << ' ';}}
      |                             ^~~~
a.cc:146:5: error: redefinition of 'int lg2(long long int)'
  146 | int lg2(long long x)   {   return 64 - __builtin_clzll(x) - 1;  }
      |     ^~~
a.cc:39:5: note: 'int lg2(long long int)' previously defined here
   39 | int lg2(long long x)   {   return 64 - __builtin_clzll(x) - 1;  }
      |     ^~~
a.cc:147:5: error: redefinition of 'int lg2(int)'
  147 | int lg2(int x)   {   return 32 - __builtin_clzll(x) - 1;        }
      |     ^~~
a.cc:40:5: note: 'int lg2(int)' previously defined here
   40 | int lg2(int x)   {   return 32 - __builtin_clzll(x) - 1;        }
      |     ^~~
a.cc:149:8: error: redefinition of 'struct pair_hash'
  149 | struct pair_hash{
      |        ^~~~~~~~~
a.cc:42:8: note: previous definition of 'struct pair_hash'
   42 | struct pair_hash{
      |        ^~~~~~~~~
a.cc:158:5: error: redefinition of 'int fast_mod(int, int)'
  158 | int fast_mod(int x, int m = MOD) {
      |     ^~~~~~~~
a.cc:51:5: note: 'int fast_mod(int, int)' previously defined here
   51 | int fast_mod(int x, int m = MOD) {
      |     ^~~~~~~~
a.cc:164:5: error: redefinition of 'int mod_add(int, int)'
  164 | int mod_add(int x, int y) {
      |     ^~~~~~~
a.cc:57:5: note: 'int mod_add(int, int)' previously defined here
   57 | int mod_add(int x, int y) {
      |     ^~~~~~~
a.cc:168:15: error: redefinition of 'std::map<int, int> mask [20]'
  168 | map<int, int> mask[MAXN];
      |               ^~~~
a.cc:61:15: note: 'std::map<int, int> mask [20]' previously declared here
   61 | map<int, int> mask[MAXN];
      |               ^~~~
a.cc:169:6: error: redefinition of 'bool liar [20]'
  169 | bool liar[MAXN];
      |      ^~~~
a.cc:62:6: note: 'bool liar [20]' previously declared here
   62 | bool liar[MAXN];
      |      ^~~~
a.cc:171:5: error: redefinition of 'int main()'
  171 | int main() {
      |     ^~~~
a.cc:64:5: note: 'int main()' previously defined here
   64 | int main() {
      |     ^~~~