Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i = 0;i<((ll)(n));i++)
#define reg(i,a,b) for(ll i = ((ll)(a));i<=((ll)(b));i++)
#define irep(i,n) for(ll i = ((ll)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(ll i = ((ll)(b));i>=((ll)(a));i--)
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
template<class T = int> void print(vector<T> v){for(auto a:v)cout<<a<<" ";cout<<endl;}

/*
*/

template<int MOD>
struct ModInt {
	static const int Mod = MOD;
	unsigned x;
	ModInt() : x(0) { }
	ModInt(signed sig) { int sigt = sig % MOD; if (sigt < 0) sigt += MOD; x = sigt; }
	ModInt(signed long long sig) { int sigt = sig % MOD; if (sigt < 0) sigt += MOD; x = sigt; }
	int get() const { return (int)x; }

	ModInt &operator+=(ModInt that) { if ((x += that.x) >= MOD) x -= MOD; return *this; }
	ModInt &operator-=(ModInt that) { if ((x += MOD - that.x) >= MOD) x -= MOD; return *this; }
	ModInt &operator*=(ModInt that) { x = (unsigned long long)x * that.x % MOD; return *this; }
	ModInt &operator/=(ModInt that) { return *this *= that.inverse(); }

	ModInt operator+(ModInt that) const { return ModInt(*this) += that; }
	ModInt operator-(ModInt that) const { return ModInt(*this) -= that; }
	ModInt operator*(ModInt that) const { return ModInt(*this) *= that; }
	ModInt operator/(ModInt that) const { return ModInt(*this) /= that; }

	ModInt inverse() const {
		signed a = x, b = MOD, u = 1, v = 0;
		while (b) {
			signed t = a / b;
			a -= t * b; std::swap(a, b);
			u -= t * v; std::swap(u, v);
		}
		if (u < 0) u += Mod;
		ModInt res; res.x = (unsigned)u;
		return res;
	}
};
mint modpow(ll _a, ll n) {
	mint r=1,a=_a;
	while(n){
		r*=((n%2)?a:1);
		a*=a;
		n>>=1;
	}
	return r;
}
typedef ModInt<2> mint;
vector<mint> fact, factinv;
void nCr_computeFactinv(int N) {
	N = min(N, mint::Mod - 1);
	fact.resize(N + 1); factinv.resize(N + 1);
	fact[0] = 1;
	reg(i, 1, N) fact[i] = fact[i - 1] * i;
	factinv[N] = fact[N].inverse();
	for (int i = N; i >= 1; i --) factinv[i - 1] = factinv[i] * i;
}
mint nCr(int n, int r) {
	if (n >= mint::Mod)
		return nCr(n % mint::Mod, r % mint::Mod) * nCr(n / mint::Mod, r / mint::Mod);
	return r > n ? 0 : fact[n] * factinv[n - r] * factinv[r];
}
mint nPr(int n, int r) {
	if (r<0)return 0;
	return r > n ? 0 : fact[n] * factinv[n-r];
}
mint nHr(int n, int r) { return r == 0 ? 1 : nCr(n + r - 1, r); }

ll ma=0;
bool one=false;

int main(void){
	cin>>n;
	cin>>s;
	rep(i,n)a[i] = s[i]-'0';
	nCr_computeFactinv(n);
	mint sum=0;
	rep(i,n)sum += nCr(n-1,i)*(a[i]%2);
	rep(i,n)if(a[i]==1)one=true;
	if(sum.get()==1){
		cout<<1<<endl;
	}else{
		if(one){
			cout<<0<<endl;
		}else{
			cout<<2<<endl;
		}
	}
	return 0;
}

Compiler output:
a.cc:46:1: error: 'mint' does not name a type; did you mean 'uint'?
   46 | mint modpow(ll _a, ll n) {
      | ^~~~
      | uint
a.cc: In function 'int main()':
a.cc:80:14: error: 'n' was not declared in this scope; did you mean 'yn'?
   80 |         cin>>n;
      |              ^
      |              yn
a.cc:81:14: error: 's' was not declared in this scope
   81 |         cin>>s;
      |              ^
a.cc:82:17: error: 'a' was not declared in this scope
   82 |         rep(i,n)a[i] = s[i]-'0';
      |                 ^
a.cc:85:36: error: 'a' was not declared in this scope
   85 |         rep(i,n)sum += nCr(n-1,i)*(a[i]%2);
      |                                    ^
a.cc:86:20: error: 'a' was not declared in this scope
   86 |         rep(i,n)if(a[i]==1)one=true;
      |                    ^