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

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

int main(){
	ios_base::sync_with_stdio(false);
	vector< pair<pair<string,int>,int> > rest(100);
	int n;cin>>n;
	for(int i=0;i<n;i++){cin>>rest[i].first.first>>rest[i].first.second;rest[i].second=i;}
	sort(rest.begin,rest.end());
	for(int i=0;i<n;i++)printf("%d\n",rest[i].second+1);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: no matching function for call to 'sort(<unresolved overloaded function type>, std::vector<std::pair<std::pair<std::__cxx11::basic_string<char>, int>, int> >::iterator)'
    9 |         sort(rest.begin,rest.end());
      |         ~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<pair<pair<__cxx11::basic_string<char>, int>, int>*, vector<pair<pair<__cxx11::basic_string<char>, int>, int> > >]'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:32: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to '__gnu_cxx::__normal_iterator<std::pair<std::pair<std::__cxx11::basic_string<char>, int>, int>*, std::vector<std::pair<std::pair<std::__cxx11::basic_string<char>, int>, int> > >'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |          ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 2 provided
Language: C++

#include<stdio.h>
#include<map>
#include<iostream>
#include<string>
using namespace std;

typedef pair<string, int> P;
typedef pair<P, int> Q;

Q q[100];

int main() {
    int n;
    cin >> n;
    for(int i = 0; i < n; i++) {
        string s;
        int p;
        cin >> s >> p;
        q[i] =Q(P(s, -p), i);
    }
    sort(q, q + n);
    for(int i = 0; i < n; i++) printf("%d\n", q[i].second + 1);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   21 |     sort(q, q + n);
      |     ^~~~
      |     short
Language: C++

#include <iostream>
#include <string>
#include <utility>
using namespace std;
typedef pair<string, int> P;
typedef pair<P, int> PP;

int main()
{
    int n;
    cin >> n;
    string s[102];
    int p[102];
    P pa[102];
    PP ppa[102];
    for(int i = 0; i < n; i++){
        cin >> s[i] >> p[i];
        p[i] = -p[i];
        pa[i] = P(s[i], p[i]);
        ppa[i] = PP(pa[i], i);
    }
    sort(ppa, ppa + n);
    for(int i = 0; i < n; i++){
        cout << ppa[i].second + 1 << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   22 |     sort(ppa, ppa + n);
      |     ^~~~
      |     short
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<string,ll> P;
#define M 1000000007
int main(){
  ll n;
  cin>>n;
  vector<P> p(n),q(n);
  map<P,ll> m;
  for(int i=0;i<n;i++){
    cin>>s>>l;
    p[i]=P(s,-l);
    q[i]=p[i];
  }
  sort(p.begin(),p.end());
  for(ll i=0;i<n;i++){
    m[p[i]]=i+1;
  }
  for(int i=0;i<n;i++){
    cout<<m[q[i]]<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: 's' was not declared in this scope
   12 |     cin>>s>>l;
      |          ^
a.cc:12:13: error: 'l' was not declared in this scope
   12 |     cin>>s>>l;
      |             ^
Language: C++

#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>

struct Data
{
    std::string city;
    int score, id;

    Data(std::string city = "", int score = 0, int id = 0) : city(city), score(score), id(id) {}
};

int cmp(const Data& x, const Data& y)
{
    if (x.city < y.city)
        return 1;
    else if (x.city > y.city)
        return 0;
    else
        return x.score > y.score;
}

int n, p;
std::string s;
Data d[100010];

int main()
{
    std::ios::sync_with_stdio(0), std::cin.tie(0), std::cout.tie(0);
    std::cin >> n;
    for (int i = 1; i <= n; ++i)
        std::cin >> s >> p,
        d[i] = Data(s, p, i);
    std::sort(d + 1, d + n + 1, cmp);
    for (int i = 1; i <= n; ++i)
        std::cout << d[i].id << std:

Compiler output:
a.cc: In function 'int main()':
a.cc:42:36: error: expected primary-expression before ':' token
   42 |         std::cout << d[i].id << std:
      |                                    ^
a.cc:42:37: error: expected '}' at end of input
   42 |         std::cout << d[i].id << std:
      |                                     ^
a.cc:34:1: note: to match this '{'
   34 | {
      | ^
Language: C++

#include<iostream>
#include<iomanip>
#include<math.h>
#include<algorithm>
#include<utility>
#include<queue>
#include<string.h>
#include<string>
#include<set>
#include<map>
#include<vector>
using namespace std;
typedef long long LL;
typedef pair<string, pair<int,int> > P;

//int A,P;
int N;
P s[105];
int main(){
    cin>>A>>P;
    cout<<(3*A+P)/2;

    cin>>N;
    for(int i=0;i<N;i++){
        cin>>s[i].first>>s[i].second.first;
        s[i].second.second=i;
    }
    sort(s,s+N);
    for(int i=0;i<N;i++){
        cout<<s[i].second.second<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:10: error: 'A' was not declared in this scope
   20 |     cin>>A>>P;
      |          ^
a.cc:20:14: error: expected primary-expression before ';' token
   20 |     cin>>A>>P;
      |              ^
a.cc:21:17: error: expected primary-expression before ')' token
   21 |     cout<<(3*A+P)/2;
      |                 ^
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>

using namespace std;
typedef long long ll;
#define int ll

ll n, m;
pair<string, pair<int, int> > f[777];

signed main()
{
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> f[i].first >> f[i].second.first;
        f[i].second.first *= -1;
        f[i].second.second = i + 1;
    }
    sort(f, f + n, comp);
    for (int i = 0; i < n; i++)
    {
        cout << f[i].second.second << "\n";
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:20: error: 'comp' was not declared in this scope
   25 |     sort(f, f + n, comp);
      |                    ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:26:39: error: 'vec' was not declared in this scope
   26 |                         for (int id : vec[j]) {
      |                                       ^~~
Language: C++

import Foundation

// 標準入力からnとmを受け取る
let nm = readLine()!.split(separator:" ").map{Int($0)!}
let n = nm[0]
let m = nm[1]

// 標準入力からkとsを受け取る
// 要素がすべて0で初期化されたn*mの2次元配列Sを用意
var S = [[Int]](repeating:[Int](repeating:0, count:m), count:n)
// Sに入力値を入れていく
for i in 0..<m{
    let s = readLine()!.split(separator:" ").map{Int($0)!}
    // s[0]==k
    for j in 0...s[0]{
        // kは除く
        if j == 0 {
            continue
        }
        S[j-1][i] = 1
    }
}

// 標準入力からpを受け取る (答えの配列)
let p = readLine()!.split(separator:" ").map{Int($0)!}

// 答えを入れる変数を用意
var ans = 0

// 要素数nの集合についてbit全探索を行う
// 0~n^2のループ
for bit in 0..<(1<<n){

    // 電球の状態を持つ配列 (点灯しているなら1,消えているなら0)
    var check = [Int](repeating:0, count:m)
    
    // 順に左にシフトさせ最下位bitのチェックを行う
    for i in 0..<n{
    
        // フラグが立っているかどうかの判定
        if bit & 1<<i > 0 {
        
            // フラグが立っていた時の処理 (フラグが立つ = スイッチを入れる)
            // 各電球に対して全探索
            for j in 0..<m{
            
                // S[i][j] == 1ならばスイッチと電球はつながっている
                // スイッチを入れると点灯と消灯が反転する
                if S[i][j] == 1 && check[j] == 1{
                    check[j] = 0
                }
                else if S[i][j] == 1 && check[j] == 0{
                    check[j] = 1
                }
            }
        }
    }
    
    // 一致しているならすべて点灯している
    if p == check{
        ans += 1
    }
}

// 答えの出力
print(ans)

Compiler output:
a.cc:12:10: error: too many decimal points in number
   12 | for i in 0..<m{
      |          ^~~
a.cc:15:14: error: too many decimal points in number
   15 |     for j in 0...s[0]{
      |              ^~~~~
a.cc:32:12: error: too many decimal points in number
   32 | for bit in 0..<(1<<n){
      |            ^~~
a.cc:38:14: error: too many decimal points in number
   38 |     for i in 0..<n{
      |              ^~~
a.cc:45:22: error: too many decimal points in number
   45 |             for j in 0..<m{
      |                      ^~~
a.cc:1:1: error: 'import' does not name a type
    1 | import Foundation
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'let' does not name a type
    5 | let n = nm[0]
      | ^~~
a.cc:25:1: error: 'let' does not name a type
   25 | let p = readLine()!.split(separator:" ").map{Int($0)!}
      | ^~~
a.cc:28:1: error: 'var' does not name a type
   28 | var ans = 0
      | ^~~
a.cc:66:6: error: expected constructor, destructor, or type conversion before '(' token
   66 | print(ans)
      |      ^
Language: C++

// 

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

int main(){
    // 入力
    int N, M; cin >> N >> M; // N:スイッチ総数, M:電球総数
    vector<vector<int>> S(M);
    vector<int> P(M);

    for (int m=0; m<M; ++m){
        int K; cin >> K;
        for(int k=0; k<K; k++){
            int s; cin >> s;
            S[m].push_back(s);
        }
    }

    for(int n=0; n<N; n++) cin >> P[n];
    
    // bit探索
    int ans =0;
    for (int ptn = 0; ptn<(1<<N); ptn++){
        vector<int> S_cnt(M); // 点灯スイッチ数格納用
        for (int j=0; j<N; j++){
            if (ptn>>j&1){
                for (int m=0; m<M; m++){
                    for (int k=0; k<S[m].size(); k++){
                        if(S[m][k] == j+1) S_cnt[m] += 1;
                    }
                }
            }
        }
        for (int m=0; m<M; m++){
            tmp = S_cnt[m] % 2;
            if (tmp!=P[m]) break;
            if (m==M-1) ans += 1;   
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:13: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   37 |             tmp = S_cnt[m] % 2;
      |             ^~~
      |             tm
Language: C++

// 

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

int main(){
    // 入力
    int N, M; cin >> N >> M; // N:スイッチ総数, M:電球総数
    vector<vector<int>> S(M);
    vector<int> P(M);

    for (int m=0; m<M; ++m){
        int K; cin >> K;
        for(int k=0; k<K; k++){
            int s; cin >> s;
            S[m].push_back(s);
        }
    }

    for(int n=0; n<N; n++) cin >> P[n];
    
    // bit探索
    int ans =0;
    for (int ptn = 0; ptn<(1<<N); ptn++){
        vector<int> S_cnt(M); // 点灯スイッチ数格納用
        for (int j=0; j<N; j++){
            if (ptn>>j&1){
                for (int m=0; m<M; m++){
                    for (int k=0; k<S[m].size(); k++){
                        if(S[m][k] == j+1) S_cnt[m] += 1;
                    }
                }
            }
        }
        for (int m=0; m<M; m++){
            P[m] %= 2;
            if (tmp!=P[m]) break;
            if (m==M-1) ans += 1;   
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:17: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   38 |             if (tmp!=P[m]) break;
      |                 ^~~
      |                 tm
Language: C++

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

int main(){
    // 入力
    int N, M; cin>>N>>M; // M:電球の種類, N:スイッチの数
    int ans=0;
    vector<vector<int>> swi(M); // 各電球に繋がれているスイッチ
    vector<int> p(M); // 各電球の点灯条件

    for(int i=0; i<M; i++){ // swi(M)を取得
        int k; cin>>k; // 繋がれているスイッチの個数
        for(int j=0; j<k; j++){ 
            int s; cin>>s; // 繋がれているスイッチ
            swi[i].push_back(s);
        }
    }

    for(int i=0;i<m;i++) cin>>p[i]; // 電球の点灯条件

    // bit全探索
    for(int bit=0; bit<(1<<n) ;bit++){ // 2^n通りの探索
        vector<int> s_cnt(m); // 各スイッチ数のカウント

        for(int j=0; j<N; j++){ // j番目のスイッチについて
            if(bit>>j&1){ // 2進数第j桁目が1の場合...
                for(int i=0; i<M; i++){ // 各電球の点灯判定
                    for(int k=0; k<swi[i].size(); k++){ // 入力スイッチの個数を数える
                        if(swi[i][k]==j+1) s_c[i]++;
                    }
                }
            }
        }
        for(int l=0;l<m;l++){
            s_c[l]%=2;
            if(s_c[l]!=p[l]) break;
            if(l==m-1){
                ans++;
            }
        }
    }
    cout<<ans<<endl;
}
/

Compiler output:
a.cc: In function 'int main()':
a.cc:19:19: error: 'm' was not declared in this scope
   19 |     for(int i=0;i<m;i++) cin>>p[i]; // 電球の点灯条件
      |                   ^
a.cc:22:28: error: 'n' was not declared in this scope
   22 |     for(int bit=0; bit<(1<<n) ;bit++){ // 2^n通りの探索
      |                            ^
a.cc:23:27: error: 'm' was not declared in this scope
   23 |         vector<int> s_cnt(m); // 各スイッチ数のカウント
      |                           ^
a.cc:29:44: error: 's_c' was not declared in this scope; did you mean 's_cnt'?
   29 |                         if(swi[i][k]==j+1) s_c[i]++;
      |                                            ^~~
      |                                            s_cnt
a.cc:35:13: error: 's_c' was not declared in this scope; did you mean 's_cnt'?
   35 |             s_c[l]%=2;
      |             ^~~
      |             s_cnt
a.cc: At global scope:
a.cc:44:1: error: expected unqualified-id before '/' token
   44 | /
      | ^
Language: C++

#include <bits/stdc++.h>
#define rep(i , n) for(int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
const int MOD = 1e9 + 7;
int main() {
    int N, M;
    cin >> N >> M;
    int ans = 0;
    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.at(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.at(i);
            }
        }
        if(t == P){
            ans++;
        }
    }
    cout << ans << endl;
}


Compiler output:
a.cc:23:5: error: expected unqualified-id before 'for'
   23 |     for(int i = 0; i < M; i++){
      |     ^~~
a.cc:23:20: error: 'i' does not name a type
   23 |     for(int i = 0; i < M; i++){
      |                    ^
a.cc:23:27: error: 'i' does not name a type
   23 |     for(int i = 0; i < M; i++){
      |                           ^
a.cc:28:5: error: expected unqualified-id before 'for'
   28 |     for(int s = 0; s < (1<<N); s++){
      |     ^~~
a.cc:28:20: error: 's' does not name a type
   28 |     for(int s = 0; s < (1<<N); s++){
      |                    ^
a.cc:28:32: error: 's' does not name a type
   28 |     for(int s = 0; s < (1<<N); s++){
      |                                ^
a.cc:39:5: error: 'cout' does not name a type
   39 |     cout << ans << endl;
      |     ^~~~
a.cc:40:1: error: expected declaration before '}' token
   40 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n,m;
  cin >> n >> m;
  vector<int>a(n);
  int p=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;
    }
  }
  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:26:24: error: expected ')' before ';' token
   26 |     for(int i=0;i<n;i++;){
      |        ~               ^
      |                        )
a.cc:26:25: error: expected primary-expression before ')' token
   26 |     for(int i=0;i<n;i++;){
      |                         ^
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 k;
    cin >> k;
    for(int j=0;j<k;++j){
      int s;
      cin >> s;
      s--;
      a[s] |= 1 << i;
    }
  }
  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:20:5: error: 'p' was not declared in this scope
   20 |     p |= x << i;
      |     ^
a.cc:25:24: error: expected ')' before ';' token
   25 |     for(int i=0;i<n;i++;){
      |        ~               ^
      |                        )
a.cc:25:25: error: expected primary-expression before ')' token
   25 |     for(int i=0;i<n;i++;){
      |                         ^
a.cc:30:11: error: 'p' was not declared in this scope
   30 |     if(t==p){
      |           ^
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define pi 3.14159265358979
#define mod 1000000007
#define rep(i,n) for(ll i=0;i<n;i++)
using namespace std;
 
int main(){
    ll n,m,count,cnt,ans=0;
    
    cin>>n>>m;
  int s[11][11],p[11],k[11];
    rep(i,m){
        cin>>k[i];
        rep(j,k[i]){
            cin>>s[i][j];
        }
    }
    rep(i,m){
        cin>>p[i];
    }
    rep(bit,(1<<n)){
        cnt=0;
        rep(i,m){
            count=0;
            rep(j,k[i]){
                if(bit&(1<<(s[i][j]-1))){
                    count++;
                }
            }
            if(count%2==p[i]){
                cnt++;
            }
        }
        if(cnt==m){
            ans++;
        }
    }
    cout<<ans;
}#include <bits/stdc++.h>
#define ll long long
#define pi 3.14159265358979
#define mod 1000000007
#define rep(i,n) for(ll i=0;i<n;i++)
using namespace std;
 
int main(){
    ll n,m,count,cnt,ans=0,s[11][11],p[11],k[11];
    cin>>n>>m;
    rep(i,m){
        cin>>k[i];
        rep(j,k[i]){
            cin>>s[i][j];
        }
    }
    rep(i,m){
        cin>>p[i];
    }
    rep(bit,(1<<n)){
        cnt=0;
        rep(i,m){
            count=0;
            rep(j,k[i]){
                if(bit&(1<<(s[i][j]-1))){
                    count++;
                }
            }
            if(count%2==p[i]){
                cnt++;
            }
        }
        if(cnt==m){
            ans++;
        }
    }
    cout<<ans;
}

Compiler output:
a.cc:40:2: error: stray '#' in program
   40 | }#include <bits/stdc++.h>
      |  ^
a.cc:40:3: error: 'include' does not name a type
   40 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:47:5: error: redefinition of 'int main()'
   47 | int main(){
      |     ^~~~
a.cc:8:5: note: 'int main()' previously defined here
    8 | int main(){
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define pi 3.14159265358979
#define mod 1000000007
#define rep(i,n) for(ll i=0;i<n;i++)
using namespace std;
 
int main(){
    ll n,m,count,cnt,ans=0;
    
    cin>>n>>m;
  int s[11][11],p[11],k[11];
    rep(i,m){
        cin>>k[i];
        rep(j,k[i]){
            cin>>s[i][j];
        }
    }
    rep(i,m){
        cin>>p[i];
    }
    rep(bit,(1<<n)){
        cnt=0;
        rep(i,m){
            count=0;
            rep(j,k[i]){
                if(bit&(1<<(s[i][j]-1))){
                    count++;
                }
            }
            if(count%2==p[i]){
                cnt++;
            }
        }
        if(cnt==m){
            ans++;
        }
    }
    cout<<ans;
}#include <bits/stdc++.h>
#define ll long long
#define pi 3.14159265358979
#define mod 1000000007
#define rep(i,n) for(ll i=0;i<n;i++)
using namespace std;
 
int main(){
    ll n,m,count,cnt,ans=0;
    
    cin>>n>>m;
  int s[11][11],p[11],k[11];
    rep(i,m){
        cin>>k[i];
        rep(j,k[i]){
            cin>>s[i][j];
        }
    }
    rep(i,m){
        cin>>p[i];
    }
    rep(bit,(1<<n)){
        cnt=0;
        rep(i,m){
            count=0;
            rep(j,k[i]){
                if(bit&(1<<(s[i][j]-1))){
                    count++;
                }
            }
            if(count%2==p[i]){
                cnt++;
            }
        }
        if(cnt==m){
            ans++;
        }
    }
    cout<<ans;
}

Compiler output:
a.cc:40:2: error: stray '#' in program
   40 | }#include <bits/stdc++.h>
      |  ^
a.cc:40:3: error: 'include' does not name a type
   40 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:47:5: error: redefinition of 'int main()'
   47 | int main(){
      |     ^~~~
a.cc:8:5: note: 'int main()' previously defined here
    8 | int main(){
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define pi 3.14159265358979
#define mod 1000000007
#define rep(i,n) for(ll i=0;i<n;i++)
using namespace std;

int main(){
    ll n,m,count,cnt,ans=0;
    
    cin>>n>>m;
  int s[11][11],p[11],k[11];
    rep(i,m){
        cin>>k[i];
        rep(j,k[i]){
            cin>>s[i][j];
        }
    }
    rep(i,m){
        cin>>p[i];
    }
    rep(bit,(1<<n)){
        cnt=0;
        rep(i,m){
            count=0;
            rep(j,k[i]){
                if(bit&(1<<(s[i][j]-1))){
                    count++;
                }
            }
            if(count%2==p[i]){
                cnt++;
            }
        }
        if(cnt==m){
            ans++;
        }
    }
    cout<<ans;
}#include <bits/stdc++.h>
#define ll long long
#define pi 3.14159265358979
#define mod 1000000007
#define rep(i,n) for(ll i=0;i<n;i++)
using namespace std;

int main(){
    ll n,m,count,cnt,ans=0;
    
    cin>>n>>m;
  int s[11][11],p[11],k[11];
    rep(i,m){
        cin>>k[i];
        rep(j,k[i]){
            cin>>s[i][j];
        }
    }
    rep(i,m){
        cin>>p[i];
    }
    rep(bit,(1<<n)){
        cnt=0;
        rep(i,m){
            count=0;
            rep(j,k[i]){
                if(bit&(1<<(s[i][j]-1))){
                    count++;
                }
            }
            if(count%2==p[i]){
                cnt++;
            }
        }
        if(cnt==m){
            ans++;
        }
    }
    cout<<ans;
}

Compiler output:
a.cc:40:2: error: stray '#' in program
   40 | }#include <bits/stdc++.h>
      |  ^
a.cc:40:3: error: 'include' does not name a type
   40 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:47:5: error: redefinition of 'int main()'
   47 | int main(){
      |     ^~~~
a.cc:8:5: note: 'int main()' previously defined here
    8 | int main(){
      |     ^~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

#define rep(i,n)  for(int i=0;i<n;++i)
#define sc2(a,b)  scanf("%d %d",&a,&b)

int main(){
    int n,m,ans=0;
    sc2(n,m);
    int k[15][15];
    int p[15]={0};
    rep(i,15) rep(j,15) k[i][j]=0;
    rep(i,m) {
        sc1(k[i][0]);
        rep(j,k[i][0]) sc1(k[i][j+1]);
    }
    rep(i,m) sc1(p[i]);
    rep(i,pow(2,n)) {
        int x=i;
        int s[15]={0};
        rep(j,n) {
            if (x&1)  s[j]=1;
            x=x>>1;
        }
        int chk=0;
        rep(j,m) {
            int cnt=0;
            rep(a,k[j][0]) if (s[k[j][a+1]-1]==1) cnt=(cnt+1)%2;
            if (cnt==p[j]) chk++;
        }
        if (chk==m) ans++;
    }
    printf("%d\n",ans);

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'sc1' was not declared in this scope; did you mean 'sc2'?
   15 |         sc1(k[i][0]);
      |         ^~~
      |         sc2
a.cc:18:14: error: 'sc1' was not declared in this scope; did you mean 'sc2'?
   18 |     rep(i,m) sc1(p[i]);
      |              ^~~
      |              sc2
Language: C

#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
const int INF = 1e9;

int main() {
  int n, m; cin >> n >> m;
  vector<int> k(m);
  vector<vector<int>> s(m);
  vector<int> p(m);

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

  int ans = 0;
  for (int bits = 0; bits < (1 << n); ++bits) {
    bool all_ok = true;
    for (int i = 0; i < m; ++i) {
      int cnt = 0;
      for (int j = 0; j < k[i]; ++j) {
        if ( (bits >> j) & 1 ) cnt++;
      }
      if (p[i] != (cnt % 2)) all_ok = false;
    }
    if (all_ok) ++ans;
  }
  cout << ans << endl;
}


Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <bits.stdc++.h>
using namespace std;
int main(){
  int N,M; cin>>N>>M;
  vector<int>K(M);
  vector<vector<int>>S(M,vector<int>(N));
  vector<int>p(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];
  long long ans=0;
  for(int bit=0;bit<=(1<<N);bit++){
    vector<bool>C(N,false);
    for(int i=0;i<N;i++)if(bit&(1<<i))C[i]=true;
    for(int i=0;i<M;i++){
      long long count=0;
      for(int j=0;j<K[i];j++)if(C[S[i][j]])count++;
      if(count%2!=p[i])break;
      if(i==M-1)ans++;
    }
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc:1:10: fatal error: bits.stdc++.h: No such file or directory
    1 | #include <bits.stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <unordered_map>
#include <vector>

using namespace std;

// https://atcoder.jp/contests/abc128/tasks/abc128_c

int main() {
  int n, m;
  cin >> n >> m;
  unordered_map<int, vector<int>> mp;
  for (int i = 0; i < m; ++i) {
    int k;
    cin >> k;
    for (int j = 0; j < k; ++j) {
      int s;
      cin >> s;
      mp[i+1].emplace_back(s);
    }
  }
  vector<int> ptn(m);
  for (int i = 0; i < m; ++i) cin >> ptn[i];

  int ans = 0;
  // N個あるスイッチの全on/offをbit全探索
  for (int bit = 0; bit < (1 << n); ++bit) {
    vector<int> bits;
    for (int i = 0; i < n; ++i) {
      if (bit & (1 << i)) {
        bits.emplace_back(i+1);
      }
    }

    int total = 0;
    for (auto& [i, s] : mp) {
      int on = 0;
      for (auto e : bits) {
        if (find(s.begin(), s.end(), e) != s.end()) ++on;
      }
      if (on % 2 == ptn[i-1]) ++total;
    }
    if (total == m) ++ans;
  }

  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:17: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   39 |         if (find(s.begin(), s.end(), e) != s.end()) ++on;
      |             ~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:39:17: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   39 |         if (find(s.begin(), s.end(), e) != s.end()) ++on;
      |             ~~~~^~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <unordered_map>
#include <vector>

using namespace std;

// https://atcoder.jp/contests/abc128/tasks/abc128_c

int main() {
  int n, m;
  cin >> n >> m;
  unordered_map<int, vector<int>> mp;
  for (int i = 0; i < m; ++i) {
    int k;
    cin >> k;
    for (int j = 0; j < k; ++j) {
      int s;
      cin >> s;
      mp[i+1].emplace_back(s);
    }
  }
  vector<int> ptn(m);
  for (int i = 0; i < m; ++i) cin >> ptn[i];

  int ans = 0;
  // N個あるスイッチの全on/offをbit全探索
  for (int bit = 0; bit < (1 << n); ++bit) {
    vector<int> bits;
    for (int i = 0; i < n; ++i) {
      if (bit & (1 << i)) {
        bits.emplace_back(i+1);
      }
    }

    int total = 0;
    for (auto& [i, s] : mp) {
      int on = 0;
      for (auto& e : bits) {
        if (find(s.begin(), s.end(), e) != s.end()) {
          ++on;
        }
      }
      if (on % 2 == ptn[i-1]) ++total;
    }
    if (total == m) ++ans;
  }

  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:17: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   39 |         if (find(s.begin(), s.end(), e) != s.end()) {
      |             ~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:39:17: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   39 |         if (find(s.begin(), s.end(), e) != s.end()) {
      |             ~~~~^~~~~~~~~~~~~~~~~~~~~~~
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++;  ///若第cnt开关打开时，并且能够控制第i盏灯，则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 <iostream>
#include <vector>
#include <set>

using namespace std;

set<int> v;

int dfs(int i, int m, int **s, int *p, int n, int *k) {
    if (i == m) {
        bool flag = true;
        for (int j = 0; j < n; j++) {
            int cnt = 0;
            for (int l = 0; l < k[j]; l++) {
                if (v.find(s[j][l]) != v.end())
                    cnt++;
            }
            if (cnt % 2 != p[j])
                flag = false;
        }
        if (flag)
            return 1;
        else 
            return 0;
    }

    int ans = 0;
    v.insert(i);
    ans += dfs(i+1, m, s, p, n, k);
    v.erase(i);
    ans += dfs(i+1, m, s, n, p, k);
    return ans;
}

int main() {
    int n, m;   cin >> n >> m;
    int *k = new int[n], **s = new int*[n], *p = new int[m];
    for (int i = 0; i < n; i++) {
        cin >> k[i];
        s[i] = new int[k[i]];

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

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

    cout << dfs(0, m, s, p, n, k) << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int dfs(int, int, int**, int*, int, int*)':
a.cc:31:27: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   31 |     ans += dfs(i+1, m, s, n, p, k);
      |                           ^
      |                           |
      |                           int
a.cc:9:37: note:   initializing argument 4 of 'int dfs(int, int, int**, int*, int, int*)'
    9 | int dfs(int i, int m, int **s, int *p, int n, int *k) {
      |                                ~~~~~^
a.cc:31:30: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   31 |     ans += dfs(i+1, m, s, n, p, k);
      |                              ^
      |                              |
      |                              int*
a.cc:9:44: note:   initializing argument 5 of 'int dfs(int, int, int**, int*, int, int*)'
    9 | int dfs(int i, int m, int **s, int *p, int n, int *k) {
      |                                        ~~~~^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define rep2(i,a,n) for(int i=(a); i<(n); i++)
#define all(vec) vec.begin(),vec.end()
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
int main() {
  int N, M; cin >> N >> M;
  vvi sw(M, vi(0)); 
  rep(i,M){
    int k; cin >> k;
    rep(j,k){
      int a; cin >> a;
      sw[i].push_back(a);
    }
  }
  vi lt(M);
  rep(i,M){ int a; cin >> a; lt[i]=a;}
    
  int ans =0;
  for (int bit=0; bit<(1<<N); bit++){
    vi jg(M,0);
    for (int i=0; i<N; i++){
      if(bit & (1<<i)) {
        rep(k,M){
          rep(l, (int)sw[k].size()){
            if(i == (sw[k][l]-1) ) jg[k]++;
          }
        } 
      }
    }
    rep(i,M) jg[i] %=2;
    if(lt==jg) ans++;
  cout << ans << endl;
}
  

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

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

#define rep(i, n) for(int i = 0; i < n; i++)

int main()
{
    int n, m; cin >> n >> m;
    vector<int> bi(m), pi(m);
    int k, s, ans = 0;
    rep(i, m){
        cin >> k;
        bi[i] = 0;
        rep(j, k){
            cin >> s;
            bi[i] |= (1 << (s-1));
        }
    }
    rep(i, m){
        cin >> pi[i];
    }

    rep(b, (1 << n)){
        bool isAllOn = true;
        rep(i, m){
            if((bitset<12>((bi[i] & b)).count() % 2) != pi[i])
                isAllOn = false;
        }
        if(isAllOn) ans++;
    }

    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:17: error: 'bitset' was not declared in this scope
   30 |             if((bitset<12>((bi[i] & b)).count() % 2) != pi[i])
      |                 ^~~~~~
a.cc:6:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
    5 | #include <vector>
  +++ |+#include <bitset>
    6 | using namespace std;
a.cc:30:41: error: request for member 'count' in '(bi.std::vector<int>::operator[](((std::vector<int>::size_type)i)) & b)', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   30 |             if((bitset<12>((bi[i] & b)).count() % 2) != pi[i])
      |                                         ^~~~~
Language: C++

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

ing 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 cnt = 0;
      for(int id : vec[j]){
        if((i >> id) & 1){
          cnt++;
        }
      }
      if(cnt % 2 != p[j]){
        ok = false;
      }
    }
    if(ok){
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc:4:1: error: 'ing' does not name a type; did you mean 'int'?
    4 | ing main(){
      | ^~~
      | int
Language: C++

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

int main(){
    int N, M;
    int k, s, p;
    cin >> N >> M;
    vector<vector<int>> light(M);
    vector<int> P;
    for (int i = 0; i < M; i++){
        cin >> k;
        for (int j = 0; j < k; j++){
            cin >> s;
            light.at(i).push_back(s);
        }
    }
    for (int i = 0; i < M; i++){
        cin >> p;
        P.push_back(p);
    }
    int ans = 0;
    bool all_on;
    for (int bit = 0; bit < (1 << N); bit++){
        all_on = true;
        for (int i = 0; i < M; i++){
            int on = 0;
            for (int j = 0; j < light.at(i).size(); j++){
                if (bit & (1 << light.at(i).at(j) - 1)){
                    on += 1;
                }
            }
            if (on % 2 != P.at(i)){
                all_on = false;
            }            
        }
        if (all_o´®n){
            ans += 1;
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc:36:13: error: extended character ® is not valid in an identifier
   36 |         if (all_o´®n){
      |             ^
a.cc: In function 'int main()':
a.cc:36:13: error: 'all_o\U000000b4\U000000aen' was not declared in this scope; did you mean 'all_on'?
   36 |         if (all_o´®n){
      |             ^~~~~~~~
      |             all_on
Language: C++

#include <iostream>
#include<vector>
using namespace std;
int main(void){
    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++;
                      }
                }
                if(c % 2 != p[j]){
                      ok = false;
                }
          }
          if(ok){
                ans++
          }
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:22: error: expected ';' before '}' token
   41 |                 ans++
      |                      ^
      |                      ;
   42 |           }
      |           ~
Language: C++

#include <bits/stdc++.h>
#include <math.h>
#include <vector>
#include <queue>
#include <iomanip>
#include <string>
#include <algorithm>
using namespace std;
using Graph = vector<vector<int>>;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep_1 (i,j,n) for(int i=j;i<n;i++)
typedef long long ll;
typedef long l;
const ll l_INF = 1010101010101010;
const int INF = 1010101010;
const int dx[4] = {-1,0,1,0};
const int dy[4] = {0,-1,0,1};
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using vvll = vector<vll>;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

int main(){
  int n,m; cin>>n>>m;
  vi k(m);
  vector<set<int>> s(m);
  rep(i,m){
    cin>>k[i];
    rep(j,k[i]){
      int in; cin>>in;
      s[i].insert(in);
    }
  }
  //各電球のonのスイッチの合計
  vi sum(m);
  int p=0;
  int cnt=0;
  rep(i,m){
    int p_0; cin>>p_0;
    p+=(1<<i)*p_0;
  }
  rep(i,1<<n){
    int res=0;
    rep(i_1,m){
      rep(j,n){
        if(((i>>j)&1)&&s[i_1].count(j+1)) sum[i_1]++;
      }
    }
    //check
    /*bool judge=true;
    rep(i_2,m){
      if(sum[i_2]%2!=p[i_2]) judge=false;
    }
    if(judge) count++;*/
    rep(j,n){
      rep+=(sum[j]%2)*(1<<j);
    }
    if(res==p) cnt++;
  }
  cout<<cnt;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:7: error: 'rep' was not declared in this scope
   58 |       rep+=(sum[j]%2)*(1<<j);
      |       ^~~
Language: C++

#include<iostream>
using namespace std;
int main(){
  int n,m;
  cin>>n>>m;
  int k[m],s[m][20];
  for(int i=0;i<m;i++){
    cin>>k[i];
    for(int j=0;j<k[i];j++){
      cin>>a[i][j];
    }
  }
  int p[m],ans=0;
  for(int i=0;i<m;i++) cin>>p[i];
  int ans=0;
  for(int bit=0;bit<(1<<n);i++){
    int light=0;
    for(int i=0;i<m;i++){
      int cnt=0;
      for(int j=0;j<k[i];j++){
        if(bit&(1<<a[i][j]-1)) cnt++;
      }
      if(p[i]==0&&cnt%2==0) light++;
      if(p[i]==1&&cnt%2==1) light++;
    }
    if(light==m) ans++;
  }
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: 'a' was not declared in this scope
   10 |       cin>>a[i][j];
      |            ^
a.cc:15:7: error: redeclaration of 'int ans'
   15 |   int ans=0;
      |       ^~~
a.cc:13:12: note: 'int ans' previously declared here
   13 |   int p[m],ans=0;
      |            ^~~
a.cc:16:28: error: 'i' was not declared in this scope
   16 |   for(int bit=0;bit<(1<<n);i++){
      |                            ^
a.cc:21:20: error: 'a' was not declared in this scope
   21 |         if(bit&(1<<a[i][j]-1)) cnt++;
      |                    ^
Language: C++

#include<iostream>
using namespace std;
int main(){
int n,;
  cin>>n>>m;
  int k[m],a[m][10];
  for(int i=0;i<m;i++){
      cin>>k[m];
    for(int j=0;j<k[i];i++){
      cin>>a[i][j];
    }
  }
  int p[m],ans=0;
  for(int i=0;i<m;i++) cin>>p[i];
  for(int bit=0;bit<(1<<n);bit++){
     int light=0;
     for(int i=0;i<m;i++){
       int cnt=0;
       for(int j=0;j<a[i][j]-1;j++){
       if(bit&(1<<s[i][j]-1)) cnt++;
     }
if(p[i]==0&&(cnt%2==0)) light++;
       if(p[i]==1&&(cnt%2==1)) light++;
     }
if(light==m) ans++;
  }
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:7: error: expected unqualified-id before ';' token
    4 | int n,;
      |       ^
a.cc:5:11: error: 'm' was not declared in this scope
    5 |   cin>>n>>m;
      |           ^
a.cc:8:12: error: 'k' was not declared in this scope
    8 |       cin>>k[m];
      |            ^
a.cc:10:12: error: 'a' was not declared in this scope
   10 |       cin>>a[i][j];
      |            ^
a.cc:14:29: error: 'p' was not declared in this scope
   14 |   for(int i=0;i<m;i++) cin>>p[i];
      |                             ^
a.cc:19:22: error: 'a' was not declared in this scope
   19 |        for(int j=0;j<a[i][j]-1;j++){
      |                      ^
a.cc:20:19: error: 's' was not declared in this scope
   20 |        if(bit&(1<<s[i][j]-1)) cnt++;
      |                   ^
a.cc:22:4: error: 'p' was not declared in this scope
   22 | if(p[i]==0&&(cnt%2==0)) light++;
      |    ^
a.cc:23:11: error: 'p' was not declared in this scope
   23 |        if(p[i]==1&&(cnt%2==1)) light++;
      |           ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
using namespace std;
using ll=long long;
using P =pair<int,int>;

int main(){
int n,m;
cinl>>n>>m;
vector<vector<int>>vec(m);
rep(i,m){
int k;cin>>k;
vec[i].resize(k);
rep(j,k){
cin>>vec[i][j];
--vec[i][j];
}
}
vector<int>p(m);
rep(i,m)cin>>p[i];
int ans=0;
for(int i=0;i<(1<<n);++i){
bool ok=true;
rep(j,m){
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:9:1: error: 'cinl' was not declared in this scope; did you mean 'sinl'?
    9 | cinl>>n>>m;
      | ^~~~
      | sinl
a.cc: At global scope:
a.cc:40:1: error: 'cout' does not name a type
   40 | cout<<ans<<endl;
      | ^~~~
a.cc:41:1: error: expected unqualified-id before 'return'
   41 | return 0;
      | ^~~~~~
a.cc:42:1: error: expected declaration before '}' token
   42 | }
      | ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
using namespace std;
using ll=long long;
using P =pair<int,int>;

int main(){
int n,m;
cinl>>n>>m;
vector<vector<int>>vec(m);
rep(i,m){
int k;cin>>k;
vec[i].resize(k);
rep(j,k){
cin>>vec[i][j];
--vec[i][j];
}
}
vector<int>p(m);
rep(i,m)cin>>p[i];
int ans=0;
for(int i=0;i<(1<<n);++i){
bool ok=true;
rep(j,m){
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:9:1: error: 'cinl' was not declared in this scope; did you mean 'sinl'?
    9 | cinl>>n>>m;
      | ^~~~
      | sinl
a.cc:27:13: error: expected ')' before '{' token
   27 | if((i>>id)&1{++c;}
      |   ~         ^
      |             )
a.cc:28:1: error: expected primary-expression before '}' token
   28 | }
      | ^
a.cc: At global scope:
a.cc:40:1: error: 'cout' does not name a type
   40 | cout<<ans<<endl;
      | ^~~~
a.cc:41:1: error: expected unqualified-id before 'return'
   41 | return 0;
      | ^~~~~~
a.cc:42:1: error: expected declaration before '}' token
   42 | }
      | ^