criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.io.*;
import java.util.*;
public class Main {
 public static void main(String[] args) throws Exception {
  Scanner file = new Scanner(System.in);
  int n = file.nextInt();
  int m = file.nextInt();
  int[][] a = new int[m][];
  for (int i = 0; i < m; i++) {
   int k = file.nextInt();
   a[i] = new int[k];
   for (int j = 0; j < k; j++) {
    a[i][j] = file.nextInt() - 1; 
   }
  }
  int[] b = new int[n];
  for (int i = 0; i < n; i++) b[i] = file.nextInt();
  int tot = 0;
  for (int i = 0; i < (1 << n); i++) {
   int count = 0;
   int[] c = new int[n];
   for (int j = 0; j < (1 << n); j <<= 1) {
    if (j & i > 0) c[(int) (Math.log(j) / Math.log(2))] = 1; 
   }
   int[] d = new int[m];
   for (int j = 0; j < m; j++) {
    int t = 0;
    for (int k = 0; k < a[j].length; k++) {
     if (c[a[j][k]] == 1) t++; 
    }
    t %= 2;
    if (t == b[j]) count++;
   }
   if (count == m) tot++;
  }
  System.out.println(tot);
  file.close();
  System.exit(0);
 }
}

Compiler output:
Main.java:23: error: bad operand types for binary operator '&'
    if (j & i > 0) c[(int) (Math.log(j) / Math.log(2))] = 1; 
          ^
  first type:  int
  second type: boolean
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
int N;
vector<int> two(int x, int y){
  vector<int> ret(N,0);
  int now=y;
  for(int i=0;i<=N-1;i++){
    if(x>=now){
      ret.at(i)=1;
      x-=now;
    }
    now/=2;
  }
  return ret;
}    
int main(){
  int M; cin >> N >> M;
  int L=1;
  if(N>=2){
    for(int i=1;i<N;i++){
      L*=2;
    }
  }
  vector<vector<int>> s(M,vector<int>(1));
  vector<int> K(M);
  for(int i=0;i<M;i++){
    int k; cin >> k;
    K.at(i)=k;
    resize(k,s.at(i));
    for(int j=0;j<k;j++){
      cin >> s.at(i).at(j);
    }
  }
  vector<int> p(M);
  for(int i=0;i<M;i++){
    cin >> p[i];
  }
  int count=0;
  int check=0;
  int ans=0;
  for(int i=0;i<L*2;i++){
    checK=0;
    vector<int> swi(N)=two(i,L);
    for(int j=0;j<M;j++){
      count=0;
      for(int l=0;l<K.at(j);l++){
        count+=swi.at(s.at(j).at(l));
      }
      if(count%2!=p.at(j)){
        check=1;
        break;
      }
    }
    if(check==0){
      ans++;
    }
  }
  cout << ans << endl;
}
  
  
  
 

Compiler output:
a.cc: In function 'int main()':
a.cc:29:5: error: 'resize' was not declared in this scope; did you mean 'dysize'?
   29 |     resize(k,s.at(i));
      |     ^~~~~~
      |     dysize
a.cc:42:5: error: 'checK' was not declared in this scope; did you mean 'check'?
   42 |     checK=0;
      |     ^~~~~
      |     check
a.cc:43:23: error: expected ',' or ';' before '=' token
   43 |     vector<int> swi(N)=two(i,L);
      |                       ^
Language: C++

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

int main(){
    int N,M;
    cin >> N >> M;
    vector<vector<int>> s(M);
    for(int i=0;i<M;i++){
        int k;
        cin >> k;
        for(int j=0;j<k;j++){
            int a;
            cin >> a;
            s[i].push_back(a-1);
        }
    }

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

    long long res = 0;
    for(int bit=0;bit<(1<<N);bit++){
        bool ok = true;
        for(int i=0;i<M;i++){
            int con = 0;
            for(auto v : s[i]){
                if(bit & (1<<v)) con++;
            }
            if(con%2 != p[i]) ok = false;
        }
        if(ok) res++
    }
    cout << res << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:21: error: expected ';' before '}' token
   31 |         if(ok) res++
      |                     ^
      |                     ;
   32 |     }
      |     ~
Language: C++

#include<bits/stdc++.h>
#define REP(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
#define int long long
using namespace std;
typedef pair<int,int> P;
//void read(int &N,int &M,vector<vector<int>> &g,vector<int>&p);
signed main(){
    int N,M;
    vector<vector<int>> to(N);
    vector<int> p(N);
    cin>>N>>M;
    REP(i,M){
        int k;cin>>k;
        REP(j,k){
            int s;cin>>s;
            s--;
            to[s].push_back(i);
        }
    }
    REP(i,M) cin>>p[i];
    int ans=0;
    REP(i,1<<N){//2^nパターン列挙
        vector<int> bulb(M,0);
        REP(j,N){//スイッチjに対してビット走査
            int bit=(i>>j)&1;
            if(bit==1) REP(k,to[j].size()) bulb[to[j][k]]++;
        }
        bool ok=true;
        REP(j,M) if(bulb[j]%2!=p[j]) ok=false;
        if(ok) ans++;
    }
    cout<<ans<<endl;
    return 0;
}

//void read(int &N,int &M,vector<vector<int>> &g,vector<int>&p){
    
}

Compiler output:
a.cc:38:1: error: expected declaration before '}' token
   38 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int n,m;
  cin >> n >> m;
  vector<int> v(n);
  for(int i=0;i<m;i++){
    int k;
    cin >> k;
    for(int j=0;j<k;j++){
      int s;
      cin >> s;
      s--;
      v[s] |= (1<<i);
    }
  }
  int p=0;
  int ans =0;
  for(int i=0;i<m;i++){
    int x;
    cin >> x;
    p |= (x<<i);
  }
  
  for(int bit; bit<(1<<n);i++){
    int t=0;
    for(int i=0;i<n;i++){
      if(bit>>i&1) {
        t ^= v[i];
      }
    }
    if(t==p) ans++;
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:27: error: 'i' was not declared in this scope
   26 |   for(int bit; bit<(1<<n);i++){
      |                           ^
Language: C++

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

string ans;
const int MAX=10;
 int N=MAX;
const int MAX2=10;
int M=MAX2;

int sum;
vector<int>k(M);
vector<int>p(M);
vector<vector<int>>dat

int dfs(int i,int a,int b,string ans,int d){
  if(i==pow(2,N)){
    return sum;
  }

  if(d==M){
    int x=0;
    int y=0;
    int chk=0;
    for(int k=0;k<N;k++){
      if(ans[k]=='A'){
        x++;
      }
      else{
        y++;
      }
    }
    
    for(int l=0;l<M;l++){
      int sum2=0;
     for(int q=0;q<N;q++){
       if(ans[date[l][q]]=='A'){
         sum2++;
         
       }
     }
      
      if(sum2%2==p[l]){
        chk++; 
    }
   
  }
    if(chk==M){
      sum++;
      string ans;
      int f=dfs(i+1,0,0,ans,1);
        return f;
      
     
    }
  }
  ans[d-1]='A';
  int m=dfs(i,a+1,b,ans,d+1);
    
    return m;
  
  ans[d-1]='B';
  
  int n=dfs(i,a,b+1,ans,d+1);
    
    return n;
  
}


  
int main(){
  string ans;
  int sum=0;
  cin>>N>>M;
  

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

  }
}

  for(int i=0;i<M;i++){
    cin>>p[i];
  }
  
  int solve=dfs(1,0,0,ans,1);
  
  cout<<solve<<endl;
}
  


Compiler output:
a.cc:15:1: error: expected initializer before 'int'
   15 | int dfs(int i,int a,int b,string ans,int d){
      | ^~~
a.cc: In function 'int main()':
a.cc:80:10: error: 'date' was not declared in this scope
   80 |     cin>>date[i][j];
      |          ^~~~
a.cc:89:13: error: 'dfs' was not declared in this scope; did you mean 'ffs'?
   89 |   int solve=dfs(1,0,0,ans,1);
      |             ^~~
      |             ffs
Language: C++

#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
int main(){
  ll N,M;cin>>N>>M;
  vector<vector <ll> > s(M);
  vector<ll> p;
  ll i,j,k,l;
  ll ans=0;
  rep(i,M){
    ll a;cin>>a;
    rep(j,a){
      cin>>s[i][j];
      s[i][j]--;
    }
  }
  rep(i,M){
    ll b;cin>>b;
    p.pb(b);
  }
  rep(i,1<<N){
    bool ok = true;
    rep(j,M){
      int cnt=0;
      rep(k,s[j].length()){
        if((i>>s[j][k])&1) cnt++;
      }
      if(cnt %2 != p.at(j)) ok=false;
    }
    if(ok) ans++;
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:18: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<long long int> >, std::vector<long long int> >::value_type' {aka 'class std::vector<long long int>'} has no member named 'length'
   46 |       rep(k,s[j].length()){
      |                  ^~~~~~
a.cc:19:32: note: in definition of macro 'rep'
   19 | #define rep(i,x) for(int i=0;i<x;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 s;
    cin >> s;
    s--;
	a[s] |= 1 << i;
  }
  for (int s=0;s < (1<<N);++s) {
    int t = 0;
    for (int i=0;i<N;i++) {
      if(s>>i&1) {
       int x ^= a[i];
      }
    }
    int and = 0;
    int p =0;
    for (int i=0;i<M;i++) {
      int x;
      cin >> x;
      p |= x << i;
    }
    int ans = 0;
    if ( t==p) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:14: error: expected initializer before '^=' token
   19 |        int x ^= a[i];
      |              ^~
a.cc:22:13: error: expected unqualified-id before '=' token
   22 |     int and = 0;
      |             ^
a.cc:34:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   34 |   cout << ans << endl;
      |           ^~~
      |           abs
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 s;
    cin >> s;
    s--;
	a[s] |= 1 << i;
  }
  for (int s=0;s < (1<<N);++s) {
    int t = 0;
    for (int i=0;i<N;i++) {
      if(s>>i&1) {
        x ^= a[i];
      }
    }
    int p =0;
    for (int i=0;i<M;i++) {
      int x;
      cin >> x;
      p |= x << i;
    }
    int ans = 0;
    if ( t==p) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'x' was not declared in this scope
   19 |         x ^= a[i];
      |         ^
a.cc:33:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   33 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include<bits/stdc++.h>
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=0;id<vec[j].size;id++){
				if((i>>vec[j][id])&1){
					++c;
				}
			}
			c%=2;
			if(c!=p[j]){
				ok=false;
			}
		}
		if(ok){
			++ans;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:48: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]' (did you forget the '()' ?)
   24 |                         for(int id=0;id<vec[j].size;id++){
      |                                                    ()
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,M;
  cin>>N>>M;
  vector<int>k(M);
  for(int i=0;i<M;i++){
    cin>>k.at(i);
    
    vector<int>s(k.at(i));
    
    for(int j=0;j<k.at(i);j++){
      cin>>s.at(j);
    }
    
  }
  
  vector<int>p(M);
  for(int i=0;i<M;i++){
    cin>>p.at(i);
  }
  
  vector<int>ans(N,false);

    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:23:27: error: expected '}' at end of input
   23 |   vector<int>ans(N,false);
      |                           ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a[N];
  for (int i=0;i< M ;i++) {
    int s;
    cin >> s;
    s--;
	a[s] |= 1 << i;
  }
  for (int s=0;s < (1<<N);++s) {
    int t = 0;
    for (int i=0;i<N;i++) {
      if(s>>i&&1) {
        x ^= a[i];
      }
    }
    int p =0;
    for (int i=0;i<M;i++) {
      int x;
      cin >> x;
      p |= x << i;
    }
    int ans = 0;
    if ( t==p) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> N >> M;
      |   ^~~
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> a[N];
      |   ^~~~~~
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> a[N];
      |          ^~~
a.cc:11:9: error: 'a' was not declared in this scope
   11 |         a[s] |= 1 << i;
      |         ^
a.cc:17:9: error: 'x' was not declared in this scope
   17 |         x ^= a[i];
      |         ^
a.cc:17:14: error: 'a' was not declared in this scope
   17 |         x ^= a[i];
      |              ^
a.cc:31:3: error: 'cout' was not declared in this scope
   31 |   cout << ans << endl;
      |   ^~~~
a.cc:31:11: error: 'ans' was not declared in this scope
   31 |   cout << ans << endl;
      |           ^~~
a.cc:31:18: error: 'endl' was not declared in this scope
   31 |   cout << ans << endl;
      |                  ^~~~
Language: C++

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

using namespace std;

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

	int n, m;
	int k[10], s[10][10], p[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];
			s[i][j]--;
		}
	}
	for (int i = 0; i < m; i++) {
		cin >> p[i];
	}

	int ans = 0;
	for (int i = 0; i < pow(2, n); i++) {
		bool on = true;
		for (int j = 0; j < m; j++) {
			int num = 0;
			for (int n = 0; n < k[j]; n++) {
				int tmp;
				tmp = i & (int)pow(2,s[j][n]);
				if (tmp != 0)num++;
			}
			if (num % 2 != p[j]) {
				on = false;
				break;
			}
		}
		if (on) ans++;
	}

	cout << ans << endl;

}

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

#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int n, m, n_pow = 0, ans = 0;
    cin >> n >> m;
    vector< vector<int> > s(m);
    vector<int> p(m);
    
    for (auto & ss:s)
    {
        int k;
        cin >> k;
        for (int j = 0; j < k; ++j)
        {
            int tmp;
            cin >> tmp;
            ss.push_back(tmp-1);
        }
    }
    for (auto &tp : p) cin >> tp;
    n_pow = (1<<n);
     
    for (int i = 0; i < n_pow; ++i)
    {
        bitset<10> bs(i);
        int index = 0;
        bool fail = false;
        for (auto & ss:s) {
            int t = 0;
            for (auto & ts : ss) t+=(int)bs[ts];
            if (t%2 != p[index++]) {
                fail = true;
                break;
            }
            ans += !fail;
        }
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:9: error: 'bitset' was not declared in this scope
   29 |         bitset<10> bs(i);
      |         ^~~~~~
a.cc:3:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
    2 | #include <vector>
  +++ |+#include <bitset>
    3 | 
a.cc:29:20: error: 'bs' was not declared in this scope; did you mean 's'?
   29 |         bitset<10> bs(i);
      |                    ^~
      |                    s
Language: C++

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

//ビット演算を利用
int main() {
  //入力
  int N, M;
  cin >> N >> M;
  //N個のスイッチの状態を表すvector
  vector<int> a(N);
  //M個の電球それぞれについて
  for (int i = 0; i < M; i++) {
    int k;
    cin >> k;
    //電球 i に繋がっている k個のスイッチについて
    for (int j = 0; j < k; j++) {
      //k個のスイッチのうちs番スイッチについて
      int s;
      cin >> s;
      s--;
      //電球が繋がってるときは１となる（１と３が繋がってるときは 10100... となる）
      a[s] |= 1<<i;
    }
  }
  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: In function 'int main()':
a.cc:42:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   42 |       ans++;
      |       ^~~
      |       abs
a.cc:47:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   47 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include <bits/stdc++.h>
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=0;id<vec[j].size;id++) {
				if ((i >> vec[j][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:28:49: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]' (did you forget the '()' ?)
   28 |                         for (int id=0;id<vec[j].size;id++) {
      |                                                     ()
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int M = scanner.nextInt();
		List<Integer> S = new ArrayList<Integer>();
		
		//各電球のスイッチの個数
		for(int i = 0; i < M; i++){
			
			int K = scanner.nextInt();
			int P = scanner.nextInt();
			//繋がっているK個のスイッチ
			for(int n = 0; n < K; n++){
				
				//onのスイッチをリストに追加
				if()
				S.add(scanner.nextInt());
			}
			int slength = S.size();
			//点灯する場合
			if(P == slength % 2){
				
				
			}
		}
	}

}


Compiler output:
Main.java:23: error: illegal start of expression
				if()
				   ^
1 error
Language: C++

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

using namespace std;

int main(){
  int N,M; cin >> N >> M;
  
  vector<vector<bool>> to(N);
  
  for(int i = 0; i < M; i++){
    int k; cin >> k
      for(int i = 0; i < k; i++){
        int s; cin >> s; s--; // 0-indexed
        to[i].push_back(s);}}
  // スイッチと電球間の隣接行列
  
 vector<int> P(M); vector<int> Q(M);
  for(int i = 0; i < M; i++){ cin >> P[i];}
  
  
  int cnt = 0;
  
  for(int i = 0; i < ( 1 << N ); i++){//bit全探索
    
    for(int x = 0; x < M; x++){ Q[x] = 0;} //毎回初期化
    
    bool flag = true;
    
    for(int j = 0; j < N; j++){
    if( i >> j & 1){  // j番目のスイッチをつける
        for(int k = 0; k < to[j].size(); k++){
          int q = to[j][k];  Q[q]++; Q[q]  = Q[q] % 2;}}}
    
    for(int l = 0; l < M; l++){
      if( P[l] != Q[l]){ flag = false;}}
    
    if(flag){ cnt++;}}
  
  cout << cnt << endl; return 0;}
    
      

Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: expected ';' before 'for'
   13 |     int k; cin >> k
      |                    ^
      |                    ;
   14 |       for(int i = 0; i < k; i++){
      |       ~~~           
a.cc:14:32: error: expected ';' before ')' token
   14 |       for(int i = 0; i < k; i++){
      |                                ^
      |                                ;
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<utility>
#include<algorithm>
#include<bitset>
#define rep(a) for(int i = 0; i < a; i++)
using namespace std;

struct LB {
	int NumofSw;
	int sw = 0;
	bool isOnwhenOdd = 0;
};

int bitcount(int bits) {
		bits = (bits & 0x5555) + (bits >> 1 & 0x5555);
		bits = (bits & 0x3333) + (bits >> 2 & 0x3333);
		bits = (bits & 0x0f0f) + (bits >> 4 & 0x0f0f);
		bits = (bits & 0x00ff) + (bits >> 8 & 0x00ff);
		return bits;
}


int main()
{
	int N, M;
	cin >> N >> M;
	//N sw
	//M lamp

	vector<LB> LBs(M);

	int temp;
	rep(M)
	{

Compiler output:
a.cc: In function 'int main()':
a.cc:36:10: error: expected '}' at end of input
   36 |         {
      |         ~^
a.cc:36:10: error: expected '}' at end of input
a.cc:26:1: note: to match this '{'
   26 | {
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int MAXN = 2<<11;
int dp[15][MAXN];
int ha[15][15];
int a[15];
int main()
{
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=m;i++){
        int t;
        scanf("%d",&t);
        while(t--){
            int x;  scanf("%d",&x);
            ha[i][x]=1;
        }
    }
    for(int i=1;i<=m;i++)   scanf("%d",&a[i]);
    for(int i=0;i<=(1<<10)-1;i++)   dp[0][i]=1;
    for(int i=1;i<=m;i++){
        for(int j=0;j<=(1<<n)-1;j++){
            int cnt=1,ans=0,k=j;
            while(k){
                if(k&1){
                    if(ha[i][cnt])  ans++;  
                }
                k>>=1;   cnt++;
            }
            if(ans%2 == a[i] && dp[i-1][j])   dp[i][j]=1;
        }
    }
    int sum=0;
    for(int i=0;i<=(1<<10)-1;i++)
        if(dp[m][i])    sum++;  
    printf("%d\n",sum);
    return 0;
}
}

Compiler output:
a.cc:39:1: error: expected declaration before '}' token
   39 | }
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    int a[n,0];

    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 p = 0;
    for(int i = 0; i < m; i++) {
        int x;
        cin >> x;
        p |= x << i;
    }
    int ans =0;
    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: In function 'int main()':
a.cc:8:12: error: expected ']' before ',' token
    8 |     int a[n,0];
      |            ^
      |            ]
a.cc:8:13: error: expected unqualified-id before numeric constant
    8 |     int a[n,0];
      |             ^
a.cc:17:13: error: 'a' was not declared in this scope
   17 |             a[s] |= 1 << i;
      |             ^
a.cc:32:22: error: 'a' was not declared in this scope
   32 |                 t ^= a[i];
      |                      ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    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 p = 0;
    for(int i = 0; i < m; i++) {
        int x;
        cin >> x;
        p |= x << i;
    }
    int ans =0;
    for(int s = 0; s < (1 << n); s++) {
        int t = 0;
        for(int i = 0; i < n; i++) {
            if(s >> i & i){
                t ^= a[i]
            }
        }
        if(t == p){
            ans++
        }
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:26: error: expected ';' before '}' token
   32 |                 t ^= a[i]
      |                          ^
      |                          ;
   33 |             }
      |             ~             
a.cc:36:18: error: expected ';' before '}' token
   36 |             ans++
      |                  ^
      |                  ;
   37 |         }
      |         ~
Language: C++

#include <iostream>
using namespace std;

int main()
{
  int N, M;
  cin >> N >> M;
  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 p = 0;
  for (int i = 0; i < M; i++)
  {
    int x;
    cin >> x;
    p |= x << i;
  }

  int ans = 0;
  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;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: 'm' was not declared in this scope
   10 |   for (int i = 0; i < m; i++)
      |                       ^
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <numeric>
#include <tuple>
#include <stack>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define print(s) cout << s << endl
using namespace std;
const int INF = 1e9;
typedef long long ll;
const ll LINF = 1e18;
const ll MOD = 1e9 + 7;
// const lint MOD = 998244353;
int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}
char upper(char c){
	return c-0x20;
}
char lower(char c){
	return c+0x20;
}

int gcd(int x, int y) {
  if (y == 0) return x;
  return gcd(y, x%y);
}
#include <bits/stdc++.h>
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:11:17: error: expected unqualified-id before '.' token
   11 | #define all(x) x.begin(),x.end()
      |                 ^
Language: C++

#include <bits/stdc++.h>
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;
}
#include <bits/stdc++.h>
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:48:5: error: redefinition of 'int main()'
   48 | int main() {
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main() {
      |     ^~~~
Language: C++

#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <functional>
#include <tuple>
#include <climits>
#include <algorithm>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <numeric>
#include <fstream>
#include <map>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <array>
#include <chrono>

int main()
{
    int N, M;
    std::cin >> N; std::cin >> M;

    std::vector<std::bitset<10>> s;

    for(int j=0; j<M; j++) {
        int v;
        std::cin >> v;
        int bit = 0;
        
        for(int i=0; i<v; i++) {
            int x; std::cin >> x;
            bit += 1 << (x - 1);
        }

        s.emplace_back(bit);
    }

    std::vector<int> P; P.resize(M);
    for(auto&& p : P) {
        std::cin >> p;
    }

    int lit = 0;
    for(int i=0; i<(std::pow(2, N)); i++) {
        std::bitset<10> test(i);
        
        for(int j=0; j<M; j++) {
            if((s[j] & test).count() % 2 != P[j])
                goto next;
        }

        lit++;
next:;
    }

    std::cout << lit << std::endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:22: error: 'bitset' is not a member of 'std'
   27 |     std::vector<std::bitset<10>> s;
      |                      ^~~~~~
a.cc:21:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
   20 | #include <chrono>
  +++ |+#include <bitset>
   21 | 
a.cc:27:29: error: template argument 1 is invalid
   27 |     std::vector<std::bitset<10>> s;
      |                             ^~
a.cc:27:29: error: template argument 2 is invalid
a.cc:27:31: error: expected unqualified-id before '>' token
   27 |     std::vector<std::bitset<10>> s;
      |                               ^~
a.cc:39:9: error: 's' was not declared in this scope
   39 |         s.emplace_back(bit);
      |         ^
a.cc:49:14: error: 'bitset' is not a member of 'std'
   49 |         std::bitset<10> test(i);
      |              ^~~~~~
a.cc:49:14: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
a.cc:49:25: error: 'test' was not declared in this scope
   49 |         std::bitset<10> test(i);
      |                         ^~~~
a.cc:52:17: error: 's' was not declared in this scope
   52 |             if((s[j] & test).count() % 2 != P[j])
      |                 ^
Language: Java

import java.util.*;

public class C {
    public static int N;
    public static int M;
    public static List<Integer> k;
    public static List<List<Integer>> s;
    public static List<Integer> p;
    public static void main (String args[]){
        Scanner scanner = new Scanner(System.in);
        N = scanner.nextInt();
        M = scanner.nextInt();
        k = new ArrayList();
        s = new ArrayList();
        p = new ArrayList();
        for(int i=0; i<M; i++){
            int ki = scanner.nextInt();
            k.add(ki);
            List<Integer> si = new ArrayList();
            for(int j=0; j<ki; j++){
                si.add(scanner.nextInt());
            }
            s.add(si);
        }
        for(int i=0; i<M; i++){
            p.add(scanner.nextInt());
        }
        int numOK = 0;
        List<Integer> switches = new ArrayList();
        Queue<List<Integer>> queue = new ArrayDeque();
        List<Integer> states = new ArrayList(Arrays.asList(0,1));
        queue.add(switches);
        while( queue.size()>0 ){
            List<Integer> now = queue.poll();

            if(now.size() == N){
                int numOnBulb = 0;
                for(int i=0; i<M; i++){
                    int numOnSwitch = 0;
                    for(Integer sij:s.get(i)){
                        numOnSwitch = numOnSwitch + now.get(sij-1);
                    }
                    if(numOnSwitch%2 == p.get(i)){
                        numOnBulb++;
                    }
                }
                if(numOnBulb==M){
                    numOK++;
                }
            }
            else{
                for(Integer nextState:states){
                    List<Integer> next = new ArrayList(now);
                    next.add(nextState);
                    if(isOK(next)){
                        queue.offer(next);
                    }
                }
            }
        }
        System.out.println(numOK);
    }

    public static boolean isOK(List<Integer> next){
        // for(int i=0; i<M; i++){
        //     int maxS = Math.max(s.get(i));
        //     if(maxS <= next.size()){
        //         int sum = 0;
        //         for(int state:next){
        //             sum = sum + state;
        //         }
        //         if()
        //         return false;
        //     }
        // }
        return true;
    }
}

Compiler output:
Main.java:3: error: class C is public, should be declared in a file named C.java
public class C {
       ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int a[15];
int da;
int n;
void dfs(int pos,int now,int target)
{
  if(pos == n){if(now == target)da++;return;}
  dfs(pos+1,now^a[pos],target);
  dfs(pos+1,now,target);
}
int main()
{
   int k;
  while(cin>>n>>k)
  {
    memset(a,0,sizeof(a));
    for(int i = 0; i < k; ++i)
    {
      int num;cin>>num;
      for(int j = 0; j < num ; ++j)
      {
         int x;cin>>x;a[x] |= (1<<i);
      }
    }
    int ans = 0;
    for(int i = 0; i < m; ++i)
    {
      int x;cin>>x;
      if(x)ans |= (1<<i);
    }
    da = 0;
    dfs(0,0,ans);
    cout<<da<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:24: error: 'm' was not declared in this scope
   27 |     for(int i = 0; i < m; ++i)
      |                        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int a[15];
int da;
int n;
void dfs(int pos,int now,int target)
{
  if(pos == n){if(now == target)da++;return;}
  dfs(pos+1,now^a[pos],target);
  dfs(pos+1,now,target);
}
int main()
{
   int k;
  while(cin>>n>>k)
  {
    memset(a,0,sizeof(a));
    for(int i = 0; i < k; ++i)
    {
      int num;cin>>num;
      for(int j = 0; j < num ; ++j)
      {
         int x;cin>>x;a[i] |= (1<<(x-1));
      }
    }
    int ans = 0;
    for(int i = 0; i < n; ++i)
    {
      int x;cin>>x;
      if(x)ans |= (1<<i);
    }
    da = 0;
    dfs(0,0,ans);
    cout<<da<<endl;
}
  
  
  
  

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

#include <iostream>
#include <vector>

int main(void){
	int N, M;
  	std::cin >> N >> M;
  	std::vector<std::vector<int>> switchSet(M);
  	for(int i = 0; i < M; ++i){
    	int k;
      	std::cin >> k;
      	switchSet[i].resize(k);
      	for(int j = 0; j < k; ++j){
          std::cin >> switchSet[i][j];
          --switchSet[i][j];
        }
    }
  
  	std::vector<int> P(M);
  	for(int i = 0; i < M; ++i) std::cin >> P[i];
  
  	int count = 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;
            }
          	if(c%2 != p[j]) ok = false;
        }
      	if(ok) ++count;
    }
  
  	return count;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:30: error: 'vec' was not declared in this scope
   26 |                 for(int id : vec[j]){
      |                              ^~~
a.cc:29:27: error: 'p' was not declared in this scope
   29 |                 if(c%2 != p[j]) ok = false;
      |                           ^
Language: C++

#include <iostream>

int main(void){
	int N, M;
  	std::cin >> N >> M;
  	std::vector<std::vector<int>> switchSet(M);
  	for(int i = 0; i < M; ++i){
    	int k;
      	std::cin >> k;
      	switchSet[i].resize(k);
      	for(int j = 0; j < k; ++j){
          std::cin >> switchSet[i][j];
          --switchSet[i][j];
        }
    }
  
  	std::vector<int> P(M);
  	for(int i = 0; i < M; ++i) std::cin >> P[i];
  
  	int count = 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;
            }
          	if(c%2 != p[j]) ok = false;
        }
      	if(ok) ++count;
    }
  
  	return count;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: 'vector' is not a member of 'std'
    6 |         std::vector<std::vector<int>> switchSet(M);
      |              ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | 
a.cc:6:26: error: 'vector' is not a member of 'std'
    6 |         std::vector<std::vector<int>> switchSet(M);
      |                          ^~~~~~
a.cc:6:26: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
a.cc:6:33: error: expected primary-expression before 'int'
    6 |         std::vector<std::vector<int>> switchSet(M);
      |                                 ^~~
a.cc:10:9: error: 'switchSet' was not declared in this scope
   10 |         switchSet[i].resize(k);
      |         ^~~~~~~~~
a.cc:17:14: error: 'vector' is not a member of 'std'
   17 |         std::vector<int> P(M);
      |              ^~~~~~
a.cc:17:14: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
a.cc:17:21: error: expected primary-expression before 'int'
   17 |         std::vector<int> P(M);
      |                     ^~~
a.cc:18:48: error: 'P' was not declared in this scope
   18 |         for(int i = 0; i < M; ++i) std::cin >> P[i];
      |                                                ^
a.cc:25:30: error: 'vec' was not declared in this scope
   25 |                 for(int id : vec[j]){
      |                              ^~~
a.cc:28:27: error: 'p' was not declared in this scope
   28 |                 if(c%2 != p[j]) ok = false;
      |                           ^
Language: C++

#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
	int N, M;
	cin >> N >> M;
	
	vector<vector<int>> sw(N, vector<int>());
	vector<int> p;

	for (int i = 0; i < M; i++)
	{
		int k;
		cin >> k;

		for (int j = 0; j < k; j++)
		{
			int s;
			cin >> s;

			sw[i].emplace_back(s-1);
		}
	}

	for (int i = 0; i < M; i++)
	{
		int j;
		cin >> j;

		p.emplace_back(j);
	}

	int light[10];
	int count = 0;

	for (int i = 0; i < pow(2, N); i++)
	{
		memset(light, 0, M * sizeof(int));

		for (int j = 0; j < N; j++)
		{
			if ((i >> j) & 1)
			{
				for (int k = 0; k < sw[j].size(); k++)
				{
					light[sw[j][k]] ++;
				}
			}
		}

		bool flag = true;
		for (int j = 0; j < M; j++)
		{
			if (light[j] % 2 != p[j])
			{
				flag = false;
				break;
			}
		}

		if (flag)
		{
			count++;
		}
	}

	cout << count << endl;

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:41:29: error: 'pow' was not declared in this scope
   41 |         for (int i = 0; i < pow(2, N); i++)
      |                             ^~~
a.cc:43:17: error: 'memset' was not declared in this scope
   43 |                 memset(light, 0, M * sizeof(int));
      |                 ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <algorithm>
  +++ |+#include <cstring>
    5 |
Language: C++

#include<iomanip>
#include <string>
#include<iostream>
#include<vector>
#include <bits/stdc++.h>
#include <stdio.h>
#include <numeric>
#include<math.h>
#include <ctype.h>
#include <algorithm> // sort
#include <map> // pair
using namespace std;
#define nin(n) int n; cin >> n;
#define kin(k) int k; cin >> k;
int main() {
  int n,m;
  cin >> n>>m;
  vector<vector<int>> vec(m);//2次元配列を宣言
  for(int i=0;i<m;i++){
    int k; cin >> k;
    vec[i].resize(k);  //kに応じて配列の大きさを確保
    for(int j=0;j<k;j++){
      cin >> vec[i][j];  //素直に入力
      vec[i][j]--;  //スイッチは0から始まるので引いておくとあとでやりやすい
    }
  }
  vector<int> p(m);
  for(int i=0;i<m;i++){
    cin >> p[i];  //スイッチの条件の配列を取得１
  }
  int ans=0;
  int snum;
  for (int bit = 0; bit < (1<<n); ++bit){　//bit全探索ですね!!
    bool ok=true;  //すべての電灯が光っているとき条件を満たす
    for(int i=0;i<m;i++){
      snum=0;  //スイッチのカウント
      for(int id:vec[i]){
        if ((bit >> id) & 1) { //本質的にはif (i & (1<<id))と同じ
		  ++snum;
	    }
      }
      snum%=2;
      if(snum!=p[i]){
        ok=false;
      }
    }
    if(ok){
      ans++;
    }
  }
  cout << ans << endl; //素直に出力
}

Compiler output:
a.cc:33:42: error: extended character 　 is not valid in an identifier
   33 |   for (int bit = 0; bit < (1<<n); ++bit){　//bit全探索ですね!!
      |                                          ^
a.cc: In function 'int main()':
a.cc:33:42: error: '\U00003000' was not declared in this scope
   33 |   for (int bit = 0; bit < (1<<n); ++bit){　//bit全探索ですね!!
      |                                          ^~
a.cc:44:9: error: 'ok' was not declared in this scope
   44 |         ok=false;
      |         ^~
a.cc:47:8: error: 'ok' was not declared in this scope
   47 |     if(ok){
      |        ^~
Language: C++

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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define MAXN 11

int k[MAXN], p[MAXN];
int switches[MAXN][MAXN];
int n,m;

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

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

    int ans = 0;
    for(int i=0; i< (1<<n); i++) {
        bool all_light = true;
        for(int j=0; j<m; j++) {
            int num_switch = 0;
            for(int l=0; l<k[j]; l++) {
                if ((i >> switches[j][l]) & 1) num_switch++;
            if (num_switch%2 != p[j]) all_light = false;
        }
        if ( all_light ) ans ++;
    }

    cout << ans << endl;
}


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

#include "pch.h"
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

vector<int> a[11];
int p[11];
int main()
{
	int n, k; 
	cin >> n >> k;
	for (int i = 0; i < k; i++) {
		int x; cin >> x;
		for (int j = 0; j < x; j++) {
			int y; cin >> y;
			a[i].push_back(y);
		}
	}

	for (int i = 0; i < k; i++)cin >> p[i];

	int ans = 0;

	for (int i = 1; i < (1 << n); i++) {
		bool f = false;
		for (int j = 0; j < k; j++) {
			int cnt = 0;
			for (int o = 0; o < a[j].size(); o++) {
				if (i & (1 << (a[j][o] - 1))) {
					cnt++;
				}
			}
			if (cnt == 0) { f = true; break; }
			cnt %= 2;
			if (cnt != p[j]) {
				f = true; break;
			}
		}
		if (!f)ans++;
	}
	cout << ans << '\n';
}
// 335


Compiler output:
a.cc:1:10: fatal error: pch.h: No such file or directory
    1 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.
Language: C

char in[120];
pair<pair<string,int>,int> p[110];
int main(){
  int a;scanf("%d",&a);
  for(int i=0;i<a;i++){
    int t;scanf("%s%d",in,&t);
    string tmp=in;
    p[i]=make_pair(make_pair(in,-t),i);
  }
  std::sort(p,p+a);
  for(int i=0;i<a;i++)printf("%d\n",p[i].second+1);
}

Compiler output:
main.c:2:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    2 | pair<pair<string,int>,int> p[110];
      |     ^
main.c: In function 'main':
main.c:4:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |   int a;scanf("%d",&a);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | char in[120];
main.c:4:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |   int a;scanf("%d",&a);
      |         ^~~~~
main.c:4:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:7:5: error: unknown type name 'string'
    7 |     string tmp=in;
      |     ^~~~~~
main.c:7:16: error: initialization of 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
    7 |     string tmp=in;
      |                ^~
main.c:8:5: error: 'p' undeclared (first use in this function)
    8 |     p[i]=make_pair(make_pair(in,-t),i);
      |     ^
main.c:8:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:10: error: implicit declaration of function 'make_pair' [-Wimplicit-function-declaration]
    8 |     p[i]=make_pair(make_pair(in,-t),i);
      |          ^~~~~~~~~
main.c:10:3: error: 'std' undeclared (first use in this function)
   10 |   std::sort(p,p+a);
      |   ^~~
main.c:10:6: error: expected ';' before '::' token
   10 |   std::sort(p,p+a);
      |      ^~
      |      ;
main.c:11:23: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   11 |   for(int i=0;i<a;i++)printf("%d\n",p[i].second+1);
      |                       ^~~~~~
main.c:11:23: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:11:23: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:11:23: note: include '<stdio.h>' or provide a declaration of 'printf'
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;
   cin >> n >> m;
   vector<vector<ll> v(m);
   REP(i,m){
       ll k;
       cin >> k;
       v[i].resize(k);
       REP(j,k){
           cin >> v[i][j];
           v[i][k] --;
       }
   }

   vector<ll> p(m);
   REP(i,m){
       cin >> p[i];
   }

   ll ans = 0;
   REP(i, (1 << n)){
       vector<ll> f(n);
       REP(j, n){
           if(i & (1<<j)){
               f[j] = true;
           }
       }

       bool ok = true;

       REP(j,m){
           ll cnt = 0;
           REP(k, v[j].size()){
               if(f[v[j][k]]) cnt ++;
           }
           if(cnt %2 != p[j]){
               ok = false;
               break;
           }
       }
       if(ok) ans ++;
   }
   cout << ans <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:25: error: template argument 1 is invalid
   41 |    vector<vector<ll> v(m);
      |                         ^
a.cc:41:25: error: template argument 2 is invalid
a.cc:45:8: error: 'v' was not declared in this scope
   45 |        v[i].resize(k);
      |        ^
a.cc:70:19: error: 'v' was not declared in this scope
   70 |            REP(k, v[j].size()){
      |                   ^
a.cc:18:54: note: in definition of macro 'FOR'
   18 | #define FOR(i, a, n) for(int i = (int)(a); i < (int)(n); ++i)
      |                                                      ^
a.cc:70:12: note: in expansion of macro 'REP'
   70 |            REP(k, v[j].size()){
      |            ^~~