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:13:14: error: no match for 'operator|=' (operand types are 'std::vector<int>' and 'int')
   13 |         a[s] |= 1 << i;
      |         ~~~~~^~~~~~~~~
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
                 from /usr/include/c++/14/string:68,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/cstddef:168:3: note: candidate: 'constexpr std::byte& std::operator|=(byte&, byte)'
  168 |   operator|=(byte& __l, byte __r) noexcept
      |   ^~~~~~~~
/usr/include/c++/14/cstddef:168:20: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::byte&'
  168 |   operator|=(byte& __l, byte __r) noexcept
      |              ~~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:104:3: note: candidate: 'constexpr const std::_Ios_Fmtflags& std::operator|=(_Ios_Fmtflags&, _Ios_Fmtflags)'
  104 |   operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
      |   ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:104:29: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::_Ios_Fmtflags&'
  104 |   operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
      |              ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:154:3: note: candidate: 'constexpr const std::_Ios_Openmode& std::operator|=(_Ios_Openmode&, _Ios_Openmode)'
  154 |   operator|=(_Ios_Openmode& __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
      |   ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:154:29: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::_Ios_Openmode&'
  154 |   operator|=(_Ios_Openmode& __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
      |              ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:201:3: note: candidate: 'constexpr const std::_Ios_Iostate& std::operator|=(_Ios_Iostate&, _Ios_Iostate)'
  201 |   operator|=(_Ios_Iostate& __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
      |   ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:201:28: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::_Ios_Iostate&'
  201 |   operator|=(_Ios_Iostate& __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
      |              ~~~~~~~~~~~~~~^~~
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