Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
typedef vector<int> VI;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PI;
typedef pair<ll, ll> PL;
typedef map<int, int> MI;
typedef set<int> SI;
#define VV(T) vector<vector< T > >
#define dump(x)  cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) << endl

#define rep(i, n) REP(i, 0, n)                              // 0, 1, ..., n-1
#define REP(i, x, n) for(int i = x; i < n; i++)             // x, x + 1, ..., n-1
#define FOREACH(x,a) for(auto& (x) : (a) )

#define ALL(v) (v).begin() , (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define COUT(x) cout << (x) << endl

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }


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

    int n, m; cin >> n >> m;
    vector<vector<int>> s(m, vector<int>(10, 0));
    vector<int> p(m);
    rep(i, m) {
        int k; cin >> k;
        rep(j, k) cin >> s[i][j];
    }
    rep(i, m) cin >> p[i];
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
typedef vector<int> VI;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PI;
typedef pair<ll, ll> PL;
typedef map<int, int> MI;
typedef set<int> SI;
#define VV(T) vector<vector< T > >
#define dump(x)  cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) << endl

#define rep(i, n) REP(i, 0, n)                              // 0, 1, ..., n-1
#define REP(i, x, n) for(int i = x; i < n; i++)             // x, x + 1, ..., n-1
#define FOREACH(x,a) for(auto& (x) : (a) )

#define ALL(v) (v).begin() , (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define COUT(x) cout << (x) << endl

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }


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

    int n, m; cin >> n >> m;
    vector<vector<int>> s(m, vector<int>(10, 0));
    vector<int> p(m);
    rep(i, m) {
        int k; cin >> k;
        rep(j, k) cin >> s[i][j];
    }
    rep(i, m) cin >> p[i];

    int ans = 0;
    for(int bit = 0; bit < (1<<n); bit++) {
        int flg = 1;
        for(int i = 0; i < m; i++) {
            int cnt = 0;
            for(int j = 0; j < s[i].size(); j++) {
                if(bit & (1<<s[i][j])) cnt++;
            }
            if(cnt % 2 != p[i]) flg = 0;
        }
        if(flg) ans++;
    }
    cout << ans << endl;
}#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
typedef vector<int> VI;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PI;
typedef pair<ll, ll> PL;
typedef map<int, int> MI;
typedef set<int> SI;
#define VV(T) vector<vector< T > >
#define dump(x)  cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) << endl

#define rep(i, n) REP(i, 0, n)                              // 0, 1, ..., n-1
#define REP(i, x, n) for(int i = x; i < n; i++)             // x, x + 1, ..., n-1
#define FOREACH(x,a) for(auto& (x) : (a) )

#define ALL(v) (v).begin() , (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define COUT(x) cout << (x) << endl

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }


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

    int n, m; cin >> n >> m;
    vector<vector<int>> s(m, vector<int>(10, 0));
    vector<int> p(m);
    rep(i, m) {
        int k; cin >> k;
        rep(j, k) cin >> s[i][j];
    }
    rep(i, m) cin >> p[i];

    int ans = 0;
    for(int bit = 0; bit < (1<<n); bit++) {
        int flg = 1;
        for(int i = 0; i < m; i++) {
            int cnt = 0;
            for(int j = 0; j < s[i].size(); j++) {
                if(bit & (1<<s[i][j])) cnt++;
            }
            if(cnt % 2 != p[i]) flg = 0;
        }
        if(flg) ans++;
    }
    cout << ans << endl;
}

Compiler output:
a.cc:103:2: error: stray '#' in program
  103 | }#include <bits/stdc++.h>
      |  ^
a.cc: In function 'int main()':
a.cc:73:1: error: a template declaration cannot appear at block scope
   73 | template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
      | ^~~~~~~~
a.cc:77:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   77 | int main(){
      |         ^~
a.cc:77:9: note: remove parentheses to default-initialize a variable
   77 | int main(){
      |         ^~
      |         --
a.cc:77:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:77:11: error: a function-definition is not allowed here before '{' token
   77 | int main(){
      |           ^
a.cc:103:3: error: 'include' was not declared in this scope
  103 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:103:12: error: 'bits' was not declared in this scope
  103 | }#include <bits/stdc++.h>
      |            ^~~~
a.cc:103:17: error: 'stdc' was not declared in this scope; did you mean 'std'?
  103 | }#include <bits/stdc++.h>
      |                 ^~~~
      |                 std
a.cc:104:1: error: expected primary-expression before 'using'
  104 | using namespace std;
      | ^~~~~
a.cc:106:14: error: redeclaration of 'const double EPS'
  106 | const double EPS = 1e-9;
      |              ^~~
a.cc:48:14: note: 'const double EPS' previously declared here
   48 | const double EPS = 1e-9;
      |              ^~~
a.cc:107:11: error: redeclaration of 'const int INF'
  107 | const int INF = 1e9;
      |           ^~~
a.cc:49:11: note: 'const int INF' previously declared here
   49 | const int INF = 1e9;
      |           ^~~
a.cc:108:11: error: redeclaration of 'const int MOD'
  108 | const int MOD = 1e9+7;
      |           ^~~
a.cc:50:11: note: 'const int MOD' previously declared here
   50 | const int MOD = 1e9+7;
      |           ^~~
a.cc:109:10: error: redeclaration of 'const ll LINF'
  109 | const ll LINF = 1e18;
      |          ^~~~
a.cc:51:10: note: 'const ll LINF' previously declared here
   51 | const ll LINF = 1e18;
      |          ^~~~
a.cc:131:1: error: a template declaration cannot appear at block scope
  131 | template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
      | ^~~~~~~~
a.cc:135:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
  135 | int main(){
      |         ^~
a.cc:135:9: note: remove parentheses to default-initialize a variable
  135 | int main(){
      |         ^~
      |         --
a.cc:135:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:135:11: error: a function-definition is not allowed here before '{' token
  135 | int main(){
      |           ^
a.cc:161:2: error: expected '}' at end of input
  161 | }
      |  ^
a.cc:33:11: note: to match this '{'
   33 | int main(){
      |           ^