Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define all(x) (x).begin(),(x).end()
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
using Graph = vector<vector<int>>;
const double pi=acos(-1);
template<int MOD> struct Fp {
    long long val;
    constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
        if (val < 0) val += MOD;
    }
    constexpr int getmod() { return MOD; }
    constexpr Fp operator - () const noexcept {
        return val ? MOD - val : 0;
    }
    constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; }
    constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
    constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
    constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
    constexpr Fp& operator += (const Fp& r) noexcept {
        val += r.val;
        if (val >= MOD) val -= MOD;
        return *this;
    }
    constexpr Fp& operator -= (const Fp& r) noexcept {
        val -= r.val;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr Fp& operator *= (const Fp& r) noexcept {
        val = val * r.val % MOD;
        return *this;
    }
    constexpr Fp& operator /= (const Fp& r) noexcept {
        long long a = r.val, b = MOD, u = 1, v = 0;
        while (b) {
            long long t = a / b;
            a -= t * b; swap(a, b);
            u -= t * v; swap(u, v);
        }
        val = val * u % MOD;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr bool operator == (const Fp& r) const noexcept {
        return this->val == r.val;
    }
    constexpr bool operator != (const Fp& r) const noexcept {
        return this->val != r.val;
    }
    friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept {
        return os << x.val;
    }
    friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept {
        if (n == 0) return 1;
        auto t = modpow(a, n / 2);
        t = t * t;
        if (n & 1) t = t * a;
        return t;
    }
};
using mint = Fp<MOD>;
vector<bool> seen,finished;
int pos = -1;
int ca=0;
int f=0;
void dfs(const Graph &G, int v, int p) {
    seen[v] = true;
    for (auto nv : G[v]) {
        if (nv == p) continue;
        if (finished[nv]) continue;
      if (seen[nv] && !finished[nv]) {
            pos = nv;f++; 
            return;
        }
      dfs(G, nv, v);

        // サイクル検出したならば真っ直ぐに抜けていく
        if (pos != -1) {
        return;}}
      finished[v] = true;
}
    
mint calc(long long N, long long K) {
    mint res = 1;
    for (long long n = 0; n < K; ++n) {
        res *= (N - n);
        res /= (n + 1);
    }
    return res;
}
int main() {
ll n,x; cin>>n>>x;
ll ca =0;
const a = n;
bitset<a> s(x);
for(ll i=0; i<n; i++){
ll y = x;
if(s.test(a-i-1)==1) s.set(a-i-1,0);
else s.set(a-i-1,1);
ll z = s.count();


Compiler output:
a.cc: In function 'int main()':
a.cc:111:7: error: 'a' does not name a type
  111 | const a = n;
      |       ^
a.cc:112:8: error: 'a' was not declared in this scope; did you mean 'ca'?
  112 | bitset<a> s(x);
      |        ^
      |        ca
a.cc:112:9: error: template argument 1 is invalid
  112 | bitset<a> s(x);
      |         ^
a.cc:115:6: error: request for member 'test' in 's', which is of non-class type 'int'
  115 | if(s.test(a-i-1)==1) s.set(a-i-1,0);
      |      ^~~~
a.cc:115:24: error: request for member 'set' in 's', which is of non-class type 'int'
  115 | if(s.test(a-i-1)==1) s.set(a-i-1,0);
      |                        ^~~
a.cc:116:8: error: request for member 'set' in 's', which is of non-class type 'int'
  116 | else s.set(a-i-1,1);
      |        ^~~
a.cc:117:10: error: request for member 'count' in 's', which is of non-class type 'int'
  117 | ll z = s.count();
      |          ^~~~~
a.cc:117:18: error: expected '}' at end of input
  117 | ll z = s.count();
      |                  ^
a.cc:113:22: note: to match this '{'
  113 | for(ll i=0; i<n; i++){
      |                      ^
a.cc:117:18: error: expected '}' at end of input
  117 | ll z = s.count();
      |                  ^
a.cc:108:12: note: to match this '{'
  108 | int main() {
      |            ^