criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<bits/stdc++.h>
#define REP(i,n) fot(int (i)=0 ;(i)<(n);(i)++)
#define REPR(i,n) for(int (i)=(n);(i)>=0;(i)--)
#define FOR(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define ALL(x) x.begin(),x.end()
#define REVERSE(x) reverse(x.begin(),x.end())
typedef long long LL;
const double INF = 1e9;
using namespace std;
int binary(int bina){
  int ans =0;
  for(int i=0;bina>0;i++){
    ans = ans+(bina%2)*pow(10,i);
    bina = bina/2;
  }
  return ans;
}
int main(){
  int N,M;
  cin>>N>>M;
  int k[M];
  int s[10][10];
  for(int i=0;i<M;i++){
  cin>>k[i];
  for(int j=0;j<k[i];j++){
  cin>>s[i][j];
  }
}
  int p[M];
  for(int i=0;i<M;i++){
    cin>>p[i];
  }
  int ans=0;
  for(int i=0;i<1024;i++){
    bool judge = true;
    for(int a=0;a<M;a++){
      int sum=0;
      for(int b=0;b<k[a];b++){
        sum+=(binary[i]%pow(10,s[a][b]))/pow(10,s[a][b]);
      }
      if(sum%2!=p[a]){
        judge=false;
      }
    }
    if(judge){
      ans++;
    }
  }
  cout<<ans;
}
    
        

Compiler output:
a.cc: In function 'int main()':
a.cc:39:23: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   39 |         sum+=(binary[i]%pow(10,s[a][b]))/pow(10,s[a][b]);
      |                       ^
a.cc:39:24: error: invalid operands of types 'int(int)' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
   39 |         sum+=(binary[i]%pow(10,s[a][b]))/pow(10,s[a][b]);
      |               ~~~~~~~~~^~~~~~~~~~~~~~~~
      |                       |    |
      |                       |    __gnu_cxx::__promote<double>::__type {aka double}
      |                       int(int)
Language: C++

#include<bits/stdc++.h>
#define REP(i,n) fot(int (i)=0 ;(i)<(n);(i)++)
#define REPR(i,n) for(int (i)=(n);(i)>=0;(i)--)
#define FOR(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define ALL(x) x.begin(),x.end()
#define REVERSE(x) reverse(x.begin(),x.end())
typedef long long LL;
const double INF = 1e9;
using namespace std;
int binary(int bina){
  int ans =0;
  for(int i=0;bina>0;i++){
    ans = ans+(bina%2)*pow(10,i);
    bina = bina/2;
  }
  return ans;
}
int main(){
  int N,M;
  cin>>N>>M;
  int k[M];
  int s[10][10];
  REP(int i=0;i<M;i++){
  cin>>k[i];
  for(int j=0;j<k[i];j++){
  cin>>s[i][j];
  }
}
  int p[M];
  REP(int i=0;i<M;i++){
    cin>>p[i];
  }
  int ans=0;
  REP(int i=0;i<1024;i++){
    bool judge = true;
    REP(int a=0;a<M;a++){
      int sum=0;
      REP(int b=0;b<k[a];b++){
        sum+=(binary[i]%pow(10,s[a][b]))/pow(10,s[a][b]);
      }
      if(sum%2!=p[a]){
        judge=false;
      }
    }
    if(judge){
      ans++;
    }
  }
  cout<<ans;
}
    
        

Compiler output:
a.cc:23:22: error: macro "REP" requires 2 arguments, but only 1 given
   23 |   REP(int i=0;i<M;i++){
      |                      ^
a.cc:2:9: note: macro "REP" defined here
    2 | #define REP(i,n) fot(int (i)=0 ;(i)<(n);(i)++)
      |         ^~~
a.cc:30:22: error: macro "REP" requires 2 arguments, but only 1 given
   30 |   REP(int i=0;i<M;i++){
      |                      ^
a.cc:2:9: note: macro "REP" defined here
    2 | #define REP(i,n) fot(int (i)=0 ;(i)<(n);(i)++)
      |         ^~~
a.cc:34:25: error: macro "REP" requires 2 arguments, but only 1 given
   34 |   REP(int i=0;i<1024;i++){
      |                         ^
a.cc:2:9: note: macro "REP" defined here
    2 | #define REP(i,n) fot(int (i)=0 ;(i)<(n);(i)++)
      |         ^~~
a.cc:36:24: error: macro "REP" requires 2 arguments, but only 1 given
   36 |     REP(int a=0;a<M;a++){
      |                        ^
a.cc:2:9: note: macro "REP" defined here
    2 | #define REP(i,n) fot(int (i)=0 ;(i)<(n);(i)++)
      |         ^~~
a.cc:38:29: error: macro "REP" requires 2 arguments, but only 1 given
   38 |       REP(int b=0;b<k[a];b++){
      |                             ^
a.cc:2:9: note: macro "REP" defined here
    2 | #define REP(i,n) fot(int (i)=0 ;(i)<(n);(i)++)
      |         ^~~
a.cc: In function 'int main()':
a.cc:23:3: error: 'REP' was not declared in this scope
   23 |   REP(int i=0;i<M;i++){
      |   ^~~
a.cc:30:6: error: expected ';' before '{' token
   30 |   REP(int i=0;i<M;i++){
      |      ^                ~
      |      ;
a.cc:34:6: error: expected ';' before '{' token
   34 |   REP(int i=0;i<1024;i++){
      |      ^                   ~
      |      ;
Language: C++

#include<bits/stdc++.h>
#define REP(i,n) fot(int (i)=0 ;(i)<(n);(i)++)
#define REPR(i,n) for(int (i)=(n);(i)>=0;(i)--)
#define FOR(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define ALL(x) x.begin(),x.end()
#define REVERSE(x) reverse(x.begin(),x.end())
typedef long long LL;
const double INF = 1e9;
using namespace std;
int binary(int bina){
  int ans =0;
  for(int i=0;bina>0;i++){
    ans = ans+(bina%2)*pow(10,i);
    bina = bina/2;
  }
  return ans;
}
int main(){
  int N,M;
  cin>>N>>M;
  int k[M];
  int s[10][10];
  REP(i,M){
  cin>>k[i];
  REP(j,k[i]){
  cin>>s[i][j];
  }
}
  int p[M];
  REP(i,M){
    cin>>p[i];
  }
  int ans=0;
  REP(i,1024){
    bool judge = true;
    REP(a,M){
      int sum=0;
      REP(b,k[a]){
        sum+=(binary[i]%pow(10,s[a][b]))/pow(10,s[a][b]);
      }
      if(sum%2!=p[a]){
        judge=false;
      }
    }
    if(judge){
      ans++;
    }
  }
  cout<<ans;
}
    
        

Compiler output:
a.cc: In function 'int main()':
a.cc:23:7: error: 'i' was not declared in this scope
   23 |   REP(i,M){
      |       ^
a.cc:2:27: note: in definition of macro 'REP'
    2 | #define REP(i,n) fot(int (i)=0 ;(i)<(n);(i)++)
      |                           ^
Language: C++

import Data.Bits
import Data.List
import Control.Monad

getVals :: Read a => IO [a]
getVals = getLine >>= (return . map read . words)
getStrs = getLine >>= (return . words)

toBits ss = [sum [(shift 1 $ si-1) | si <- s] | s <- ss]
check i (b, p) = p == (popCount $ b .&. i) `mod` 2
solve n ss ps = length [i | i <- [0..(shift 1 n)-1] :: [Int], 
                        all (check i) xs]
    where
        xs = zip (toBits ss) ps

main = do
    [n, m] <- getVals :: IO [Int]
    ss <- replicateM m $ getVals >>= (return . tail) :: IO [[Int]]
    ps <- getVals :: IO [Int]
    print $ solve n ss ps

Compiler output:
a.cc:10:44: error: stray '`' in program
   10 | check i (b, p) = p == (popCount $ b .&. i) `mod` 2
      |                                            ^
a.cc:10:48: error: stray '`' in program
   10 | check i (b, p) = p == (popCount $ b .&. i) `mod` 2
      |                                                ^
a.cc:11:35: error: too many decimal points in number
   11 | solve n ss ps = length [i | i <- [0..(shift 1 n)-1] :: [Int],
      |                                   ^~~
a.cc:1:1: error: 'import' does not name a type
    1 | import Data.Bits
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long int LL;
typedef long long int ll;
typedef pair<long long int, long long int> pii;
typedef pair<double, double> pdd;

#define SORT(c) sort((c).begin(),(c).end())
#define BACKSORT(c) sort((c).begin(),(c).end(),std::greater<LL>())
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define SP << " " <<

LL mod = 1000000007;

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

  LL N,M;
  cin >> N >> M;

  vector<vector<bool>> swi(M, vector<bool>(N, false));
  REP(i,M){
    LL k;
    cin >> k;
    REP(j,k){
      LL ss;
      cin >> ss;
      swi[i][ss - 1] = true;
    }
  }

  vector<LL> p(M);

  REP(i,M){
    cin >> p[i];
  }

  LL cnt = 0;
  REP(i,1<<N){
    bool flag = true;
    REP(j,M){
      #include <bits/stdc++.h>

using namespace std;
typedef long long int LL;
typedef long long int ll;
typedef pair<long long int, long long int> pii;
typedef pair<double, double> pdd;

#define SORT(c) sort((c).begin(),(c).end())
#define BACKSORT(c) sort((c).begin(),(c).end(),std::greater<LL>())
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define SP << " " <<

LL mod = 1000000007;

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

  LL N,M;
  cin >> N >> M;

  vector<vector<bool>> swi(M, vector<bool>(N, false));
  REP(i,M){
    LL k;
    cin >> k;
    REP(j,k){
      LL ss;
      cin >> ss;
      swi[i][ss - 1] = true;
    }
  }

  vector<LL> p(M);

  REP(i,M){
    cin >> p[i];
  }

  LL cnt = 0;
  REP(i,1<<N){
    bool flag = true;
    REP(j,M){
      LL d = 0;
      REP(k, N)
      {
        if(swi[j][k]){
          if((i&(1<<k))>0){
            d++;
          }
        }
      }
      if(d%2!=p[j]){
        flag = false;
      }
    }
    if(flag){
      cnt++;
    }
  }

  cout << cnt << endl;
}
LL d = 0;
      REP(k, N)
      {
        if(swi[j][k]){
          if((i&(1<<k))>0){
            d++;
          }
        }
      }
      if(d%2!=p[j]){
        flag = false;
      }
    }
    if(flag){
      cnt++;
    }
  }

  cout << cnt << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:62:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   62 | int main()
      |         ^~
a.cc:62:9: note: remove parentheses to default-initialize a variable
   62 | int main()
      |         ^~
      |         --
a.cc:62:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:63:1: error: a function-definition is not allowed here before '{' token
   63 | {
      | ^
Language: C++

#include <iostream>
#include <math.h>
#include <numeric>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <queue>
#include <queue>
#include <sstream>
#include <set>
typedef  long long ll;
const int dx[8]={1,0,-1,0,1,-1,-1,1};
const int dy[8]={0,1,0,-1,1,1,-1,-1};
const int dr[4] = {-1, 0, 1, 0};
const int dc[4] = { 0, 1, 0,-1};
const int INF = 1e9;
#define FOR(i, a, n) for(int i = (int)(a); i < (int)(n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define SORT(a) sort(a.begin(),a.end())
#define REVERSE(a) reverse(a.begin(),a.end())
int guki (int a){
    if(a%2==0) return 0;
    else return 1;
}
int gcd(int a, int b){
    if(a%b==0){
        return b;
    }else{
        return (gcd(b,a%b));
    }
}
int lcm(int a, int b){
    int x = gcd(a,b);
    return (a*b/x);
}
using namespace std;
int main(){
   ll n,m,ans=0;
   cin >> n >> m;

   vector<vector<ll>> vec(m);

   REP(i,m){
       ll a;
       cin >> a;

       vec[i].resize(a);
       REP(j,a){
           cin >> vec[i][j];
           vec[i][j] --;
       }
    } 
    vector<ll> h(m);
    REP(i,m){
        cin >> h[i];
    }

    REP(i,(1<<n)){

        vector<ll> b(n);
        REP(j,m){
            if(i & (1<<j)){
                b[j] = true;
            }
        }
        bool fl = true;
        REP(k,m){
            ll cnt =0;
            REP(l,vec[k].size()){
                if(b[vec[k][l]]) cnt ++;
            }
            if(cnt % 2 != h[k]){ 
                fl = false;
                break;
        }
        if(fl) ans++;
    }

    cout << ans <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:81:2: error: expected '}' at end of input
   81 | }
      |  ^
a.cc:38:11: note: to match this '{'
   38 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main()
{
    int N,M; cin >> N >>M;
    
    vector<vector<int>> vec(M);
    
    for(int i = 0;i<M;i++)
    {
        int k;
        cin >> k;
        vec[i].resize(k);
        for(int j = 0; j<k;j++)
        {
            cin >> vec[i][j];
            --vec[i][j];
        }
        
    }
    vector<int>p(M);
    for(int i = 0;i<M;i++)
        cin >>p[i];
    int ans = 0;
    for(int i = 0;i<(1<<N);i++)
    {
        bool ok = true;
        for(int j = 0;j <M;j++)
        {
            int c = 0;
            for(int id : vec[j])
            {
                if((i >> id) & 1)
                {
                    ++c;
                }
            }
            c%=2;
            if(c!=p[j])
            {
                ok = false
            }
            
        }
        if(ok)
        {
            ++ans;
        }
    }
    cout << ans <<endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:27: error: expected ';' before '}' token
   42 |                 ok = false
      |                           ^
      |                           ;
   43 |             }
      |             ~
Language: C++

#include<vector>
#include<string>

using namespace std;

int N,M,cnt = 0;
int to[15][15]; int P[15]; bool switch1[15];

void count(){
    int count[15];
  
  for(int i = 1; i <= M ; i++){
    count[i] = 0;} //countを初期化
  //ある注目した電球(1からM)を灯すスイッチ全体のうち、onになっているものの個数をcountで表す
  for(int i = 1; i <= M; i++){
    for(int j = 1; j <= N; j++){
      if(to[i][j] > 0 && switch1[j] == true){ count[i]++;}}}
  //i番目の電球とj番目のスイッチがつながっていて、かつj番目のスイッチがonならば、インクリメント
    
    bool flag = true;//flag初期化
    
    for(int i = 1; i <= M; i++){
      if(count[i] % 2 != P[i]){ flag = false;}}//M個の電球に対し、点灯するかを調べる
    
    if(flag){ cnt++;} //flagが破られなければ、答えをインクリメント
  }

void dfs( int X){ //スイッチはNこ,深さXは１からNまで
  if(X == N + 1){ count(); return;}
  switch1[X] = false; dfs( X+1 );
  switch1[X] = true;  dfs( X+1 );
} //N個のスイッチに対し、on/off、をdfsで全列挙


  


int main(){
   cin >> N >> M;
 
  
  for(int i = 1; i <= M; i++){
    int c; cin >> c;
    for(int j = 1; j <= c; j++){ int d;
                                cin >> d; to[i][d]++;}}//toは隣接行列
 for(int i = 1; i <= M ; i++){ cin >> P[i];}
  
  dfs(1);
  

 cout << cnt << endl;
  
  return 0;
}
    


Compiler output:
a.cc: In function 'int main()':
a.cc:39:4: error: 'cin' was not declared in this scope
   39 |    cin >> N >> M;
      |    ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<string>
  +++ |+#include <iostream>
    3 | 
a.cc:51:2: error: 'cout' was not declared in this scope
   51 |  cout << cnt << endl;
      |  ^~~~
a.cc:51:2: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:51:17: error: 'endl' was not declared in this scope
   51 |  cout << cnt << endl;
      |                 ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include<string>
  +++ |+#include <ostream>
    3 |
Language: C++

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

int main(){
  int n,m;
  cin >>n>>m;
  int s[m][10],k[m];
  for(int i=0;i<m;i++){
    cin>>k[i];
    for(int j=0;j<k[i];j++)cin>>s[i][j];
  }
  
  int p[m];
  for(int i=0;i<m;i++)cin>>p[i];
  
  int l=1;
  for(int i=0;i<n;i++)l*=2;
  
  int t[l][10];
  t[0][0]-=1;
  for(int i=0;i<l;i++){
    t[i][0]+=1;
    for(int j=1;j<10;j++){
      if(t[i][j-1]==2){t[i][j-1]=0;t[i][j]+=1;}
    }
    if(i<l-1){for(int j=0;j<10;j++)t[i+1][j]=t[i][j];}
  }

  int count=0;

  for(int i=0;i<l;i++){
    int b=0;
    for(int j=0;j<m;j++){
      int c=0;
      for(int a=0;a<k[j];a++){
        if(t[i][s[j][a]]==1){c+=1;}
      }
      if(c%2!=p[j]){break;}
      b+=1;
    }
    if(b==m)count+=1;
  }
  cout<<count<<endl;
  return;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:3: error: return-statement with no value, in function returning 'int' [-fpermissive]
   44 |   return;
      |   ^~~~~~
Language: Java

import java.util.*;

public class Main {
    static boolean[] bits;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        int m=sc.nextInt();
        boolean[][] input=new boolean[m][n];
        bits=new boolean[n];
        int[] p=new int[m];
        int k;
        for(int i=0;i<m;i++){
          k=sc.nextInt();
          for(int j=0;j<k;j++){
            input[i][sc.nextInt()-1]=true;
          }
        }
        for(int i=0;i<m;i++){
          p[i]=sc.nextInt();
        }
        int tmp1;
        boolean tmp2;
        int ans=0;
        for(int i=0;i<Math.pow(2,n);i++){
          tmp2=false;
          for(int j=0;j<m;j++){
            tmp1=0;
            for(int k=0;k<n;k++){
              if(input[i][j]&&bits[j])tmp1++;
            }
            tmp2&=tmp1%2==p[j];
          }
          if(tmp2)ans++;
          if(i!=Math.pow(2,n)-1)update(0);
        }
        System.out.println(ans);

    }
    static void update(int pointer){
        if(!bits[pointer]){
            bits[pointer]=true;
        }else{
            bits[pointer]=false;
            update(pointer+1);
        }
    }
}


Compiler output:
Main.java:30: error: variable k is already defined in method main(String[])
            for(int k=0;k<n;k++){
                    ^
1 error
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <string>
#include <stdio.h>
using namespace std;

int main(){
    int N,M;
    cin >> N >> M;
    
    int k[M];
    int s[M][N];
    int p[M];
    int i2str[10];
    int answer = 0;
    int check = 0;

    int i,j,l;
    for(i = 0; i < M; i++){
        cin >> k[i];
        for(j = 0; j < k[i]; j++){
            cin >> s[i][j];
        }
    }
    for(i = 0; i < M; i++){
        cin >> p[M];
    }
    //i=行、j=列
    for(i = 0; i < pow(2,N); i++){
        for(l = 0; l < 10; l++){
            i2str[l] = i % 2;
            i /= 2;
        }
        for(j = 0; j < k[i]; j++){
            check += i2str[s[i][j] - 1];
            if(check % 2 != p[i]){
               ok = false;
               break;
            }
        }
    answer += ok;
    }
    cout << answer;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:16: error: 'ok' was not declared in this scope; did you mean 'k'?
   39 |                ok = false;
      |                ^~
      |                k
a.cc:43:15: error: 'ok' was not declared in this scope; did you mean 'k'?
   43 |     answer += ok;
      |               ^~
      |               k
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <string>
#include <stdio.h>
using namespace std;

int main(){
    int N,M;
    cin >> N >> M;
    
    int k[M];
    int s[M][N];
    int p[M];
    int i2str[10];
    int answer = 0;
    int check = 0;

    int i,j,l;
    for(i = 0; i < M; i++){
        cin >> k[i];
        for(j = 0; j < k[i]; j++){
            cin >> s[i][j];
        }
    }
    for(i = 0; i < M; i++){
        cin >> p[M];
    }
    //i=行、j=列
    for(i = 0; i < pow(2,N); i++){
        for(l = 0; l < 10; l++){
            i2str[l] = i % 2;
            i /= 2;
        }
        for(j = 0; j < k[i]; j++){
            check += i2str[s[i][j] - 1];
            if(check % 2 != p[i]){
               ok = false;
               break();
            }
        }
    answer += ok;
    }
    cout << answer;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:16: error: 'ok' was not declared in this scope; did you mean 'k'?
   39 |                ok = false;
      |                ^~
      |                k
a.cc:40:21: error: expected ';' before '(' token
   40 |                break();
      |                     ^
      |                     ;
a.cc:40:22: error: expected primary-expression before ')' token
   40 |                break();
      |                      ^
a.cc:43:15: error: 'ok' was not declared in this scope; did you mean 'k'?
   43 |     answer += ok;
      |               ^~
      |               k
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1000000000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
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;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}

int main() {
    int N, M;
    cin >> N >> M;
    vector<int> k(M);
    vector<vector<int>> S(M);
    REP(i, M) {
        cin >> k[i];
        REP(j, k[i]) {
            int tmp;
            cin >> tmp;
            S[i].push_back(tmp);
        }
    }
    vector<int> p(M);
    REP(i, M) { cin >> p[i]; }
    int res = 0;
    for(int bit = 0; bit < pow(2, N); bit++) {
        REP(i, M) {
            int cnt = 0;
            REP(j, k[i]) {
                if (bit & (1<<(S[i][j]-1)){
                    cnt++;
                }
                if(cnt%2 != p[i]){
                    break;
                }
            }
            if(i == M - 1) {
                res += 1;
            }
        }
    }
    cout << res << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:43: error: expected ')' before '{' token
   52 |                 if (bit & (1<<(S[i][j]-1)){
      |                    ~                      ^
      |                                           )
a.cc:58:13: error: expected primary-expression before '}' token
   58 |             }
      |             ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1000000000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
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;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}

int main() {
    int N, M;
    cin >> N >> M;
    vector<int> k(M);
    vector<vector<int>> S(M);
    REP(i, M) {
        cin >> k[i];
        REP(j, k[i]) {
            int tmp;
            cin >> tmp;
            S[i].push_back(tmp);
        }
    }
    vector<int> p(M);
    REP(i, M) { cin >> p[i]; }
    int res = 0;
    for(int bit = 0; bit < pow(2, N); bit++) {
        REP(i, M) {
            int chekckbit = 0 REP(j, k[i]) { chekckbit += pow(2, S[i][j] - 1); }
            if(chekckbit & bit != chekckbit) {
                break;
            }
            if(i == M - 1) {
                res += 1;
            }
        }
    }
    cout << res << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:2:19: error: expected ',' or ';' before 'for'
    2 | #define REP(i, n) for(ll i = 0; i < (ll)n; i++)
      |                   ^~~
a.cc:50:31: note: in expansion of macro 'REP'
   50 |             int chekckbit = 0 REP(j, k[i]) { chekckbit += pow(2, S[i][j] - 1); }
      |                               ^~~
a.cc:50:35: error: 'j' was not declared in this scope
   50 |             int chekckbit = 0 REP(j, k[i]) { chekckbit += pow(2, S[i][j] - 1); }
      |                                   ^
a.cc:2:33: note: in definition of macro 'REP'
    2 | #define REP(i, n) for(ll i = 0; i < (ll)n; i++)
      |                                 ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1000000000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
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;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}

int main() {
    int K, M;
    cin >> K >> M;
    vector<int> k(M);
    vector<vector<int>> S(M);
    REP(i, M) {
        cin >> k[i];
        REP(j, k[i]) {
            int tmp;
            cin >> tmp;
            S[i].push_back(tmp);
        }
    }
    vector<int> p(M);
    REP(i, M) { cin >> p[i]; }
    int res = 0;
    for(int bit = 0; bit < pow(2, N); bit++) {
        REP(i, M) {
            int chekckbit = 0 REP(j, k[i]) { chekckbit += pow(2, S[i][j] - 1); }
            if(chekckbit & bit != chekckbit) {
                break;
            }
            if(i == M - 1) {
                res += 1;
            }
        }
    }
    cout << res << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:48:35: error: 'N' was not declared in this scope
   48 |     for(int bit = 0; bit < pow(2, N); bit++) {
      |                                   ^
a.cc:2:19: error: expected ',' or ';' before 'for'
    2 | #define REP(i, n) for(ll i = 0; i < (ll)n; i++)
      |                   ^~~
a.cc:50:31: note: in expansion of macro 'REP'
   50 |             int chekckbit = 0 REP(j, k[i]) { chekckbit += pow(2, S[i][j] - 1); }
      |                               ^~~
a.cc:50:35: error: 'j' was not declared in this scope
   50 |             int chekckbit = 0 REP(j, k[i]) { chekckbit += pow(2, S[i][j] - 1); }
      |                                   ^
a.cc:2:33: note: in definition of macro 'REP'
    2 | #define REP(i, n) for(ll i = 0; i < (ll)n; i++)
      |                                 ^
Language: C++

#include<iostream>
#include<vector>

using namespace std;

int main(){
int N, M; cin >> N >> M;
  vector<int>a(N);
  for(int i = 0; i < M; i++){
    int k ; cin >> k;
    for(int j = 0; j < k ; j++){
      int s; cin >> s;　s--; a[s] |= 1 << i;}}
  
   int ans = 0; int p = 0;
  
  for(int i = 0; i < M; i++){
    int x; cin >> x;  p |= x << i;}
  
  for(int s = 0; s < ( 1 << N) ; s++){
    int t = 0;
    for(int i = 0; i < N; i++){
    if( s >> i & 1){ t ^= a[i];}}
    
    if( t == p){ ans++;}}
  
  cout << ans << endl;
  
  return 0;
}


Compiler output:
a.cc:12:23: error: extended character 　 is not valid in an identifier
   12 |       int s; cin >> s;　s--; a[s] |= 1 << i;}}
      |                       ^
a.cc: In function 'int main()':
a.cc:12:23: error: '\U00003000s' was not declared in this scope
   12 |       int s; cin >> s;　s--; a[s] |= 1 << i;}}
      |                       ^~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main(void) {
	int N, M;
	int counter = 0;
	cin >> N >> M;

	vector<int>k = vector<int>(M);
	vector<vector<int>>s = vector<vector<int>>(M, vector<int>(N));
	vector<int>p = vector<int>(M);
	vector<int>swt = vector<int>(N);
	vector<int>lgt = vector<int>(M);

	for (int i = 0; i < M; i++) {
		cin >> k[i];
		for (int j = 0; j < k[i]; j++) {
			cin >> s[i][j];
		}
	}

	for (int i = 0; i < M; i++) {
		cin >> p[i];
	}

	for (int i = 0; i < pow(2, N); i++) {
		int i1 = i;
		int j1 = 0;
		for (int k = 0; k < N; k++) {
			swt[k] = 0;
		}
		while (i1 > 0) {
			if (i1 % 2 == 0) {
				swt[j1] = 0;
			}
			else if (i1 % 2 == 1) {
				swt[j1] = 1;
			}
			i1 /= 2;
			j1++;
		}

		for (int j = 0; j < N; j++) {
			int count_k = 0;
			for (int k1 = 0; k1 < M; k1++) {
				//if (j < k[k1])break;
				if (s[k1][k[k1]] == j) {
					lgt[k1] += swt[k1];
				}
			}
		}

		int counter_lgt = 0;
		for (int j = 0; j < M; j++) {
			if(lgt[j] % 2 == p[j])
			counter_lgt++;
		}
		if (counter_lgt == M)
			counter++;
	}

	cout << counter << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:29: error: 'pow' was not declared in this scope
   28 |         for (int i = 0; i < pow(2, N); i++) {
      |                             ^~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main(void) {
	int N, M;
	int counter = 0;
	cin >> N >> M;

	vector<int>k = vector<int>(M);
	vector<vector<int>>s = vector<vector<int>>(M, vector<int>(N));
	vector<int>p = vector<int>(M);
	vector<int>swt = vector<int>(N);
	vector<int>lgt = vector<int>(M);

	for (int i = 0; i < M; i++) {
		cin >> k[i];
		for (int j = 0; j < k[i]; j++) {
			cin >> s[i][j];
		}
	}

	for (int i = 0; i < M; i++) {
		cin >> p[i];
	}

	for (int i = 0; i < pow(2, N); i++) {
		int i1 = i;
		int j1 = 0;
		for (int k = 0; k < N; k++) {
			swt[k] = 0;
		}
		while (i1 > 0) {
			if (i1 % 2 == 0) {
				swt[j1] = 0;
			}
			else if (i1 % 2 == 1) {
				swt[j1] = 1;
			}
			i1 /= 2;
			j1++;
		}

		for (int j = 0; j < N; j++) {
			for (int k1 = 0; k1 < M; k1++) {
				//if (j < k[k1])break;
				if (s[k1][k[j]] == j) {
					lgt[k1] += swt[k1];
				}
			}
		}

		int counter_lgt = 0;
		for (int j = 0; j < M; j++) {
			if(lgt[j] % 2 == p[j])
			counter_lgt++;
		}
		if (counter_lgt == M)
			counter++;
	}

	cout << counter << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:29: error: 'pow' was not declared in this scope
   28 |         for (int i = 0; i < pow(2, N); i++) {
      |                             ^~~
Language: C++

import itertools


N, M = map(int, input().split())
connected_switches = [[int(x) - 1 for x in input().split()[1:]] for x in range(M)]
conditions = list(map(int, input().split()))

ok = 0
for patterns in itertools.product((0, 1), repeat=N):
    patterns = list(patterns)
    is_lighting = True
    for i, lights in enumerate(connected_switches):
        turned_sw = sum([patterns[x] for x in lights])
        if turned_sw % 2 != conditions[i]:
            is_lighting = False
            break
    if is_lighting:
        ok += 1

print(ok)


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import itertools
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include<vector>
#include<string>
using namespace std;
int main() {
 int n,m,i,j,k[10],s[10][10],p[10],data[10]={1,2,4,8,16,32,64,128,256,512};
  int sum=0,d=0;
  bool g;
  cin >> n >> m;
  for (i=0;i<m;i++){
    cin >> k[i];
    for (j=0;j<k[i];j++) cin >> s[i][j];
  }
  for (i=0;i<m;i++) cin >> p[i];
  for (int t=0;t<data[n-1]*2;t++){
    g=true;
    for (i=0;i<m;i++){
      d=0;
      for (j=0;j<k[i];j++) if (t&data[s[i][j]-1]) d++;
      if (d%2!=p[i]){
        g=false;
        break;
      }
    }
    if (g) sum++;
  }
  cout << sum << endl;
  return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:30:12: error: expected '}' at end of input
   30 |   return 0;
      |            ^
a.cc:7:12: note: to match this '{'
    7 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;

int main() {
	int n, m, ans=0;
    int k[10], p[10], s[10][10];

    cin >> n >> m;
    for(int i=0; i<m; i++){
      cin >> k[i];
      for(int j=0; j<k[i]; j++){
        cin >> s[i][j];
      }
    }
    for(int i=0; i<m; i++){
        cin >> p[i];
    }

    for(int ii=0; ii<(1<<n); ii++){
        bitset<11> isOnBits(ii);
        string isOn = isOnBits.to_string().substr(11-n);
        for(int i=0; i<m; i++){
            int sum =0;
            for(int j=0; j<k[i]; j++){
                sum += isOn[ s[i][j] -1 ] == '1' ? 1 : 0;
            }
            if(sum%2 != p[i]) break;
            if(i==m-1) ans++;
        }
    }

    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: 'bitset' was not declared in this scope
   23 |         bitset<11> isOnBits(ii);
      |         ^~~~~~
a.cc:5:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
    4 | #include <vector>
  +++ |+#include <bitset>
    5 | using namespace std;
a.cc:23:20: error: 'isOnBits' was not declared in this scope
   23 |         bitset<11> isOnBits(ii);
      |                    ^~~~~~~~
Language: C++

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

int main()
{
    int n, m;
    cin >> n >> m;

    vector<pair<int, vector<int>>> ks(m);
    int s;
    vector<int> p(m);

    for (int i = 0; i < m; i++)
    {
        cin >> ks[i].first;
        for (int j = 0; j < ks[i].first; j++)
        {
            cin >> s;
            ks[i].second.push_back(s);
        }
    }
    
    for (int i = 0; i < m; i++)
        cin >> p[i];

    int sw_iter = 0x000;
    int count = 0;
    vector<int> swval(n);
    bool match;
    int num_sw_on; =0;
    for (int i = 0; i < (0x1<<n), i++)
    {
        match = true;

        for (int j = 0; j < n; j++)
        {
            swval[j] = i & (0x1 << j);
        }

        for (int k = 0; k < m; k++)
        {
            num_sw_on = 0;
            for (int l = 0; l < ks[i].first; l++)
                if (swval[(ks[i].second[l]-1)] == true) num_sw_on++;

            if (num_sw_on % 2 != p[k]) match = false;
        }

        if (match) count++;

    }
        
    cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:20: error: expected primary-expression before '=' token
   30 |     int num_sw_on; =0;
      |                    ^
a.cc:31:38: error: expected ';' before ')' token
   31 |     for (int i = 0; i < (0x1<<n), i++)
      |                                      ^
      |                                      ;
Language: C++

#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main(void) {
	int N, M;
	int counter = 0;
	cin >> N >> M;

	vector<int>k = vector<int>(M);
	vector<vector<int>>s = vector<vector<int>>(M, vector<int>(N));
	vector<int>p = vector<int>(M);
	vector<int>swt = vector<int>(N);
	vector<int>lgt = vector<int>(M);

	for (int i = 0; i < M; i++) {
		cin >> k[i];
		for (int j = 0; j < k[i]; j++) {
			cin >> s[i][j];
		}
	}

	for (int i = 0; i < M; i++) {
		cin >> p[i];
	}

	for (int i = 0; i < pow(2, N); i++) {
		int i1 = i;
		int j1 = 0;
		for (int k = 0; k < N; k++) {
			swt[k] = 0;
		}
		while (i1 > 0) {
			if (i1 % 2 == 0) {
				swt[j1] = 0;
			}
			else if (i1 % 2 == 1) {
				swt[j1] = 1;
			}
			i1 /= 2;
			j1++;
		}

		for (int j = 0; j < N; j++) {
			for (int k1 = 0; k1 < M; k1++) {
				if (j < k[j])break;
				if (s[k1][k[j]] == j) {//�q�����Ă��邩����
					lgt[k1] += swt[k1];
				}
			}
		}

		int counter_lgt = 0;
		for (int j = 0; j < M; j++) {
			if(lgt[j] % 2 == p[j])
			counter_lgt++;
		}
		if (counter_lgt == M)
			counter++;
	}

	cout << counter << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:29: error: 'pow' was not declared in this scope
   28 |         for (int i = 0; i < pow(2, N); i++) {
      |                             ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define INCANT cin.tie(0), cout.tie(0), ios::sync_with_stdio(false), cout << fixed << setprecision(20);
#define int long long
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define _overload(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(...) _overload(__VA_ARGS__, repi, _rep)(__VA_ARGS__)
#define _rev(i, n) revi(i, n, 0)
#define revi(i, a, b) for(int i = (int)(a - 1); i >= (int)(b); i--)
#define rev(...) _overload(__VA_ARGS__, revi, _rev)(__VA_ARGS__)
#define each(i, n) for(auto&& i: n)
void in(){}
template<typename F, typename... R>
bool in(F& f, R&... r){
    if(cin >> f){in(r...);return true;}
    else return false;
}
#define out(x) cout << (x)
#define space() cout << " "
#define indent() cout << '\n'
void print(){}
template<typename F, typename... R>
void print(F f, R... r){out(f), indent(), print(r...);}
#define debughead(x) cerr << "Line " << __LINE__ << ": " << #x << ": "
#define debugout(x) cerr << (x) << " "
#define debugindent() cerr << '\n'
#define debug(x) debughead(x), debugout(x), debugindent()
const int INF = 1e18, MOD = 1e9 + 7;
template<typename T>
bool chmax(T& a, T b){return (a = max(a, b)) == b;}
template<typename T>
bool chmin(T& a, T b){return (a = min(a, b)) == b;}

main(){
    INCANT;
    int n, m, res = 0;
    in(n, m);
    vector<int> v[m];
    int cnt[n + 1] = {};
    rep(i, m){
        int k;
        in(k);
        rep(j, k){
            int s;
            in(s);
            v[i].pb(s);
            cnt[s]++;
        }
    }
    int p;
    rep(i, m){
        in(p);
        rep(j, m){
            each(k, v[i]){
                if(cnt[k] % 2 == p % 2){
                    res++;
                }
            }
        }
    }
    print(pos(2,res));
}


Compiler output:
a.cc:38:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   38 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:65:11: error: 'pos' was not declared in this scope; did you mean 'pow'?
   65 |     print(pos(2,res));
      |           ^~~
      |           pow
Language: C++

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <string>
#include <bitset>
#include <list>
#include <iomanip>
using namespace std;
#define rep(i,a,n) for(ll i=a;i<n;i++)
#define rrep(i,a,n) for(ll i=n;i>=a;i--)
#define elif else if
#define all(s) s.begin(),s.end()
typedef long long ll;
typedef pair<string,ll> P;
const ll INF = 1e+17;
const ll MODcdf = 998244353;
bool pairCompare(const P& firstElof,const P& secondElof){
    return firstElof.first<secondElof.first;
}
bool pairCompare2(P firstElof,P secondElof){
    return (firstElof.second)%1000>(secondElof.second)%1000;
}
bool less_mod1000(int lhs, int rhs) {
  if ((lhs - rhs) % 1000 != 0)
    return lhs % 1000 < rhs % 1000;
  else // 5で割った余りが等しいなら普通に大小比較する
    return lhs < rhs;
}
string A="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string a="abcdefghijklmnopqrstuvwxyz";
int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    ll n,m;cin>>n>>m;
    ll k[m];
    ll in;
    vector<pair<vector<ll>,ll>> vec;
    rep(i,0,m){
        cin>>k[i];
        rep(j,0,k[i]){
            vec.first[j].push_back(cin>>in);
        }
    }
    rep(i,0,m)cin>>vec[i].second.push_back(cin>>in);
    ll memo=0;
    bool flag=true;
    ll ans=0;
    rep(i,0,1024){
        rep(j,0,m){
            memo=0;
            rep(l,0,k[j]){
                if(i&(1<<vec[j].first[l]))memo++;
            }
            if(memo%2!=vec[j].second)flag=false;
        }
        if(flag)ans++;
        flag=true;
    }
    cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:17: error: 'class std::vector<std::pair<std::vector<long long int>, long long int> >' has no member named 'first'
   44 |             vec.first[j].push_back(cin>>in);
      |                 ^~~~~
a.cc:47:34: error: request for member 'push_back' in 'vec.std::vector<std::pair<std::vector<long long int>, long long int> >::operator[](((std::vector<std::pair<std::vector<long long int>, long long int> >::size_type)i)).std::pair<std::vector<long long int>, long long int>::second', which is of non-class type 'long long int'
   47 |     rep(i,0,m)cin>>vec[i].second.push_back(cin>>in);
      |                                  ^~~~~~~~~
Language: C++

#include <iostream>
#include <map>
#include <algorithm>
#include <vector>

using namespace std;
using lli = long long int;

vector<lli> vec[10] = {};

lli p[10] = {};
lli swi[10] = {};

int main(void) {

	lli N, M;
	cin >> N >> M;

	for (int i = 0; i < M; i++) {
		lli K;
		cin >> K;
		for (int j = 0; j < K; j++) {
			lli s;
			cin >> s;
			vec[i].push_back(s);
		}
	}

	for (int i = 0; i < M; i++) {
		cin >> p[i];
	}

	lli ans = 0;

	for (int i = 0; i < (int)pow(2, N); i++) {
		for (int j = 0; j < N; j++) {
			swi[j] = (i >> j) % 2;
		}

		lli light = 0;

		for (int j = 0; j < M; j++) {
			lli sum = 0;

			for (size_t k = 0; k < vec[j].size(); k++) {
				sum += swi[vec[j][k] - 1];
			}

			if (sum % 2 == p[j]) {
				light += 1;
			}

		}

		if (light == M) {
			ans++;
		}

	}

	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:34: error: 'pow' was not declared in this scope
   35 |         for (int i = 0; i < (int)pow(2, N); i++) {
      |                                  ^~~
Language: C++

#include<iostream>
#include<vector>
#include<utility>
#include<algorithm>
#include<sstream>
#include<bitset>
#include<numeric>

using namespace std;
using ll = long long int;

vector<int> sw;
vector<int> s[10], p, kk;
int n, m;

vector<int> dfs(int a) {
	vector<int> ret;
	stringstream ss;
	ss << bitset<10>(a);
	string tmp = ss.str();
	for (int i = 10 - n; i < 10; i++) {
		ret.push_back(int(tmp[i]) - int('0'));
	}
	return ret;
}

int main(void) {
	cin >> n >> m;
	for (int i = 0; i < m; i++) {
		int ki;
		cin >> ki;
		kk.push_back(ki);
		for (int j = 0; j < ki; j++) {
			int sij;
			cin >> sij;
			s[i].push_back(sij-1);
		}
	}

	for (int j = 0; j < m; j++) {
		int pj;
		cin >> pj;
		p.push_back(pj);
	}

	sw = vector<int>(n, 0);
	int ret = 0;
	for (int i = 0; i < pow(2, n); i++) {
		sw = dfs(i);
		bool flag = true;
		for (int j = 0; j < m; j++) {
			int tmp = 0;
			for (int k = 0; k < kk[j]; k++) {
				tmp += sw[s[j][k]];
			}
			if (tmp % 2 != p[j]) {
				flag = false;
				break;
			}
		}
		if (flag) {
			ret++;
		}
	}
	cout << ret << endl;
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:29: error: 'pow' was not declared in this scope
   48 |         for (int i = 0; i < pow(2, n); i++) {
      |                             ^~~
Language: C++

#include<iostream>
#include<vector>
#include<utility>
#include<algorithm>
#include<sstream>
#include<bitset>

using namespace std;
using ll = long long int;

vector<int> sw;
vector<int> s[10], p, kk;
int n, m;

vector<int> dfs(int a) {
	vector<int> ret;
	stringstream ss;
	ss << bitset<10>(a);
	string tmp = ss.str();
	for (int i = 10 - n; i < 10; i++) {
		ret.push_back(int(tmp[i]) - int('0'));
	}
	return ret;
}

int main(void) {
	cin >> n >> m;
	for (int i = 0; i < m; i++) {
		int ki;
		cin >> ki;
		kk.push_back(ki);
		for (int j = 0; j < ki; j++) {
			int sij;
			cin >> sij;
			s[i].push_back(sij-1);
		}
	}

	for (int j = 0; j < m; j++) {
		int pj;
		cin >> pj;
		p.push_back(pj);
	}

	sw = vector<int>(n, 0);
	int ret = 0;
	for (int i = 0; i < pow(2, n); i++) {
		sw = dfs(i);
		bool flag = true;
		for (int j = 0; j < m; j++) {
			int tmp = 0;
			for (int k = 0; k < kk[j]; k++) {
				tmp += sw[s[j][k]];
			}
			if (tmp % 2 != p[j]) {
				flag = false;
				break;
			}
		}
		if (flag) {
			ret++;
		}
	}
	cout << ret << endl;
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:29: error: 'pow' was not declared in this scope
   47 |         for (int i = 0; i < pow(2, n); i++) {
      |                             ^~~
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <list>
#include <algorithm>

using namespace std;

typedef long long ll;
typedef vector<ll> vl;
typedef list<ll> listl;
typedef string str;

#define min(A, B) min(static_cast<ll>(A), static_cast<ll>(B))
#define max(A, B) max(static_cast<ll>(A), static_cast<ll>(B))

void in(ll& I)
{
	cin >> I;
}

void in(vl& I)
{
	for (auto& i : I)
	{
		cin >> i;
	}
}

void in(listl& I)
{
	for (auto& i : I)
	{
		cin >> i;
	}
}

void in(str& s)
{
	cin >> s;
}

void out(ll O)
{
	cout << O;
}

void out(vl& O)
{
	for (auto& o : O)
	{
		cout << o;
	}
}

int main()
{
	ll N;
	ll M;

	in(N);
	in(M);

	vl K(M);

	vector<vl> S(M);

	for (int i = 0; i < M; i++)
	{
		in(K[i]);
		S[i].resize(K[i]);
		in(S[i]);
	}

	vl P(M);

	in(P);

	vector<bool> B(N);

	ll NA = pow(2, N);

	ll Max = 0;

	for(int n=0;n<NA;n++)
	{
		for (int j = 0; j < N; j++)
		{
			B[j] = n & (0x1 << j);
		}

		bool ac = true;

		for (int i = 0; i < M; i++)
		{
			ll mod = 0;
			for (int j = 0; j < K[i]; j++)
			{
				mod = B[S[i][j] - 1] ? (mod + 1) % 2 : mod;
			}

			if (mod != P[i])
			{
				ac = false;
				break;
			}
		}
		if (ac)Max++;
	}

	out(Max);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:81:17: error: 'pow' was not declared in this scope
   81 |         ll NA = pow(2, N);
      |                 ^~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main() {
	int N, M;
	cin >> N >> M;
	int k[10];
	int s[10][10];
	int p[10];
	int D[10000][10];
	for (int i = 0; i < pow(2, N); i++) {
		for (int m = 0; m < M; m++) {
			D[i][m] = 0;
		}
	}
	for (int i = 0; i < M; i++) {
		cin >> k[i];
		for (int j = 0; j < k[i]; j++) {
			cin >> s[i][j];
		}
	}
	for (int i = 0; i < M; i++) {
		cin >> p[i];
	}
	int x;
	int ans = 0;
	int y;
	y = pow(2, N);
	for (int i = 0; i < y; i++) {
		for (int j = 0; j < N; j++) {
			x = pow(2, j);
			for (int m = 0; m < M; m++) {
				if ((i / x) % 2 == 1) {
					{
						for (int l = 0; l < k[m]; l++) {
							if (s[m][l] == j + 1) D[i][m]++;
						}
					}
				}
			}
		}
	}
	for (int i = 0; i < y; i++) {
		for (int m = 0; m < M; m++) {
			if (D[i][m] % 2 != p[m]) {
				ans -= 1;
				break;
			}
		}
		ans++;
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:29: error: 'pow' was not declared in this scope
   14 |         for (int i = 0; i < pow(2, N); i++) {
      |                             ^~~
a.cc:31:13: error: 'pow' was not declared in this scope
   31 |         y = pow(2, N);
      |             ^~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int factorial(int x)
{
	int tmp = x;
	for (int i = 1; i < x - 1; ++i)
		tmp *= x - i;
	return tmp;
}

int main() {
	int N, M;
	cin >> N >> M;
	int k[10];
	int s[10][10];
	int p[10];
	int D[10000][10];
	for (int i = 0; i < pow(2, N); i++) {
		for (int m = 0; m < M; m++) {
			D[i][m] = 0;
		}
	}
	for (int i = 0; i < M; i++) {
		cin >> k[i];
		for (int j = 0; j < k[i]; j++) {
			cin >> s[i][j];
		}
	}
	for (int i = 0; i < M; i++) {
		cin >> p[i];
	}
	int x;
	int ans = 0;
	for (int i = 0; i < pow(2, N); i++) {
		for (int j = 0; j < N; j++) {
			x = pow(2, j);
			for (int m = 0; m < M; m++) {
				if ((i / x) % 2 == 1) {
					{
						for (int l = 0; l < k[m]; l++) {
							if (s[m][l] == j + 1) D[i][m]++;
						}
					}
				}
			}
		}
	}
	for (int i = 0; i < pow(2, N); i++) {
		for (int m = 0; m < M; m++) {
			if (D[i][m] % 2 != p[m]) {
				ans -= 1;
				break;
			}
		}
		ans++;
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:29: error: 'pow' was not declared in this scope
   22 |         for (int i = 0; i < pow(2, N); i++) {
      |                             ^~~
a.cc:38:29: error: 'pow' was not declared in this scope
   38 |         for (int i = 0; i < pow(2, N); i++) {
      |                             ^~~
a.cc:52:29: error: 'pow' was not declared in this scope
   52 |         for (int i = 0; i < pow(2, N); i++) {
      |                             ^~~
Language: C++

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

int main()
{
    int n, m, i, j, l, ans;
    scanf("%d %d", &n, &m);
    int sw[n], light[m], p[m], s[m][n], k[m];
    for (i = 0; i < m; i++)
    {
        scanf("%d", &k[i]);
        for (j = 0; j < k[i]; j++)
        {
            scanf("%d", s[i][j]);
        }
    }

    int two = 1;
    for (i = 0; i < n; i++)
    {
        two *= 2;
    }

    string stwo;
    for (i = 0; i < two; i++)
    {
        int i2 = binary(i);
        stwo = to_string(i);
        for (j = 0; j < n; j++)
        {
            sw[j] = stwo[j];
        }

        bool flag = true;
        int a = 0;
        for (j = 0; j < m; j++)
        {
            for (l = 0; l < k[j]; l++)
            {
                if (sw[s[j][l]] == 1)
                    a++;
            }
            flag = flag && a % 2 == p[m];
        }

        if (flag)
            ans++;
    }

    printf("%d", ans);
}

int binary(int bina)
{
    int ans = 0;
    for (int i = 0; bina > 0; i++)
    {
        ans = ans + (bina % 2) * pow(10, i);
        bina = bina / 2;
    }
    return ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:18: error: 'binary' was not declared in this scope
   28 |         int i2 = binary(i);
      |                  ^~~~~~
Language: C++

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

int main() {
  int N, M;
  cin >> N >> M;
  vector<int>k(M);
  vector<int>p(M);
  for (int i = 0; i < M; i++) {
    vector<vector<int>>s(M,vector<int>(k.at(i));
    for (int j = 0; j < k.at(i); j++) {
      cin >> k.at(i) >> s.at(i).at(j);
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:48: error: expected ')' before ';' token
   10 |     vector<vector<int>>s(M,vector<int>(k.at(i));
      |                         ~                      ^
      |                                                )