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

#include <stdio.h>
#include <algorithm>
#include <vector>
#include <tuple>
using namespace std;
using ll = long long;
using pii = pair<int, int>;

int n, q, v[300000], w[300000];
void rec(vector<pii>& r, int x) {
	if (x) {
		r.emplace_back(w[x], v[x]);
		rec(r, x / 2);
	}
}
vector<pii> ref(vector<pii>& s) {
	sort(s.begin(), s.end());
	vector<pii> r;
	r.emplace_back(s[0]);
	for (int i = 1; i < s.size(); i++)
		if (r.back().second < s[i].second)
			r.emplace_back(s[i]);
	return r;
}
vector<pii> enu(vector<pii>& s) {
	vector<pii> r;
	r.emplace_back(0, 0);
	for (int i = 0; i < s.size(); i++) {
		int c = r.size();
		for (int j = 0; j < c; j++)
			r.emplace_back(r[j].first + s[i].first, r[j].second + s[i].second);
	}
	return ref(r);
}

int solve(int u, int l) {
	vector<pii> p;
	rec(p, u);

	if (p.size() <= 9) {
		vector<pii> q = enu(p);
		return upper_bound(q.begin(), q.end(), pii(l, 2e9))[-1].second;
	}
	vector<pii> v = enu(vector<pii>(p.begin(), p.begin() + (p.size() / 2)));
	vector<pii> w = enu(vector<pii>(p.begin() + (p.size() / 2), p.end()));
	if (v.size() > w.size())
		v.swap(w);
	int max_v = 0;
	for (int i = 0; i < v.size() && v[i].first <= l; i++) {
		int val = upper_bound(w.begin(), w.end(), pii(l - v[i].first, 1e9))[-1].second;
		max_v = max(max_v, v[i].second + val);
	}
	return max_v;
}
int main() {
	scanf("%d", &n);
	for (int i = 1; i <= n; i++)
		scanf("%d %d", v + i, w + i);
	scanf("%d", &q);
	for (int i = 0; i < n; i++) {
		int u, l;
		scanf("%d %d", &u, &l);
		printf("%d\n", solve(u, l));
	}
}

Compiler output:
a.cc: In function 'int solve(int, int)':
a.cc:44:29: error: cannot bind non-const lvalue reference of type 'std::vector<std::pair<int, int> >&' to an rvalue of type 'std::vector<std::pair<int, int> >'
   44 |         vector<pii> v = enu(vector<pii>(p.begin(), p.begin() + (p.size() / 2)));
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:25:30: note:   initializing argument 1 of 'std::vector<std::pair<int, int> > enu(std::vector<std::pair<int, int> >&)'
   25 | vector<pii> enu(vector<pii>& s) {
      |                 ~~~~~~~~~~~~~^
a.cc:45:29: error: cannot bind non-const lvalue reference of type 'std::vector<std::pair<int, int> >&' to an rvalue of type 'std::vector<std::pair<int, int> >'
   45 |         vector<pii> w = enu(vector<pii>(p.begin() + (p.size() / 2), p.end()));
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:25:30: note:   initializing argument 1 of 'std::vector<std::pair<int, int> > enu(std::vector<std::pair<int, int> >&)'
   25 | vector<pii> enu(vector<pii>& s) {
      |                 ~~~~~~~~~~~~~^
Language: C++

#pramga GCC optimize(2)
#include<cstdio>
#include<vector>
#include<algorithm>

using namespace std;

struct item
{
	int v;long long w;item(int vv=0,long long ww=0):v(vv),w(ww){}
}x[1<<18];
bool operator<(item a,item b){return a.v<b.v;}
item operator+(item a,item b){return item(a.v+b.v,a.w+b.w);}
int n=0;

item tmp[20];int cnt;
item A[1<<10],B[1<<10];int cntA,cntB;

int lowbit(int x){return x&-x;}
int lg[1<<10];

void cons(item* x,int n,int l,item* ans)
{
	for(int i=1;i<(1<<n);i++)
	{
		ans[i]=ans[i-lowbit(i)]+x[lg[lowbit(i)]];
		if(ans[i].v>l)ans[i].v=l+1;
	}
}

int main()
{
	scanf("%d",&n);for(int i=1;i<=n;i++)scanf("%d%lld",&x[i].w,&x[i].v);
	for(int i=1;i<1024;i++)lg[i]=lg[i/2]+1;
	int q=0;scanf("%d",&q);
	while(q--)
	{
		int pos=0,l=0;scanf("%d%d",&pos,&l);
		cnt=0;
		while(pos)
		{
			tmp[++cnt]=x[pos];pos=pos/2;
		}
		int mid=cnt/2;
		cons(tmp,mid,l,A),cons(tmp+mid,cnt-mid,l,B);cntA=1<<mid,cntB=1<<(cnt-mid);
		sort(A,A+cntA),sort(B,B+cntB);
		
		//for(int i=0;i<A.size();i++)printf("%d %d\n",A[i].v,A[i].w);
		//puts("");
		//for(int i=0;i<B.size();i++)printf("%d %d\n",B[i].v,B[i].w);
		long long ans=0,maxn=0;
		for(int i=cntA-1,j=-1;i>=0;i--)
		{
			while(j+1<cntB&&A[i].v+B[j+1].v<=l){maxn=max(maxn,B[j+1].w);j++;}
			if(j!=-1)ans=max(ans,A[i].w+maxn);
		}
		printf("%lld\n",ans);
	}
	return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #pramga; did you mean #pragma?
    1 | #pramga GCC optimize(2)
      |  ^~~~~~
      |  pragma
Language: C++

//khodaya khodet komak kon
#include <bits/stdc++.h>

#define F first
#define S second
#define pb push_back
#define all(x) x.begin(), x.end()
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")


using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

const int N = 300000 + 10;
const ll MOD = 1000000000 + 7;
const ll INF = 1000000010;
const ll LOG = 18;

int n, q, W[N], V[N], SM[600], SM2[600], ADD[N], mark[N];
pii num[600], num2[600];

int solve(int v, int L){
	int res = 0;
	vector<int> F, S;
	int cnt = 0;
	int vv = v;
	while (vv != 1){
		cnt++;
		vv /= 2;
	}
	cnt++;
	int cnt2 = 0;
	while (v != 0){
		cnt2++;
		if (cnt2 <= cnt / 2) F.pb(v);
		else S.pb(v);
		v /= 2;
	}
	int P = 0, P2 = 0;
	SM[0] = SM2[0] = 0;
	num[++P] = {0, 0};
	num2[++P2] = {0, 0};
	for (int mask = 1; mask < (1 << (F.size())); mask++){
		SM[mask] = (SM[mask ^ (mask & (-mask))] + V[F[ADD[mask & (-mask)]]]);
		SM2[mask] = (SM2[mask ^ (mask & (-mask))] + W[F[ADD[mask & (-mask)]]]);
		if (SM2[mask] <= L && mark[SM2[mask]] < SM[mask]) num[++P] = {SM2[mask], SM[mask]}, mark[SM2[mask]] = SM[mask];
	}
	for (int i = 1; i <= P; i++) mark[num[i].F] = 0;
	SM2[0] = SM[0] = 0;
	for (int mask = 1; mask < (1 << (S.size())); mask++){
		SM[mask] = (SM[mask ^ (mask & (-mask))] + V[S[ADD[mask & (-mask)]]]);
		SM2[mask] = (SM2[mask ^ (mask & (-mask))] + W[S[ADD[mask & (-mask)]]]);
		if (SM2[mask] <= L && mark[SM2[mask]] < SM[mask]) num2[++P2] = {SM2[mask], SM[mask]}, mark[SM2[mask]] = SM[mask];
	}
	for (int i = 1; i <= P2; i++) mark[num2[i].F] = 0;
	sort(num + 1, num + P + 1);
	sort(num2 + 1, num2 + p2 + 1);
//	num.resize(unique(all(num)) - num.begin());
//	num2.resize(unique(all(num2)) - num2.begin());
	int mx = 0, pnt = 1;
	for (int i = P; i >= 1; i--){
		while(pnt != P2 && num2[pnt + 1].F + num[i].F <= L) pnt++, mx = max(mx, num2[pnt].S);
		res = max(res, num[i].S + mx);
	}
	return res;
}

int32_t main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n;
	int z = 0, p = 1;
	for (int i = 0; i < 18; i++) ADD[p] = z, z ++, p *= 2;
//	cout << "YES " << n << endl;
	for (int i = 1; i <= n; i++){
		cin >> V[i] >> W[i];
	}
	cin >> q;
	for (int i = 1; i <= q; i++){
		int v, L;
		cin >> v >> L;
		cout << solve(v, L) << '\n';
	}











	return 0;
}


Compiler output:
a.cc: In function 'int solve(int, int)':
a.cc:60:31: error: 'p2' was not declared in this scope; did you mean 'P2'?
   60 |         sort(num2 + 1, num2 + p2 + 1);
      |                               ^~
      |                               P2
Language: C++

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

// Inserted snippets: io, opt, root
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
template<typename H> bool chmin(H& v1, const H v2) { if (v1 > v2) { v1 = v2; return true; } return false; }
template<typename H> bool chmax(H& v1, const H v2) { if (v1 < v2) { v1 = v2; return true; } return false; }
template<typename H> void read(H& head) { cin >> head; }
template<typename H, typename ...T> void read(H& head, T& ...tail) { cin >> head; read(tail...); }
template<typename H> void write(H head) { cout << head << '\n'; }
template<typename H, typename ...T> void write(H head, T ...tail) { cout << head << " "; write(tail...); }
template<typename ...T> void die(T ...tok) { write(tok...); exit(0); }
#pragma gcc optimize("Ofast")
#pragma gcc target("avx2")
// End snippets

struct It { int v, w; };

vector<pii> solve(vector<It> its, int L) {
	vector<pii> dp;
	dp.reserve(1 << its.size());

	dp.push_back({0, 0});

	for (It it : its) {
		vector<pii> dp2;
		dp2.reserve(sz(dp));
		for (auto p : dp) {
			if (p.first + it.w <= L) {
				dp2.push_back({ p.first + it.w, p.second + it.v });
			}
		}
		for (auto p : dp2) dp.push_back(p);
	}

	sort(all(dp), [](const pii a, const pii b) {
			if (a.first != b.first) return a.first < b.first;
			return a.second > b.second;
			});
	vector<pii> rv;
	int cv = 0;

	for (auto p : dp) {
		chmax(cv, p.second);
		if (rv.empty() || p.first != rv.back().first)
			rv.push_back({ p.first, cv });
	}

	return move(rv);
}

int main() {
	cin.tie(0)->sync_with_stdio(0);
	cin.exceptions(cin.failbit);

	int n; read(n);
	vector<It> kk(n + 1);
	rep(i, 1, n + 1) read(kk[i].v, kk[i].w);

	int q; read(q);
	rep(i, 0, q) {
		int v, l; read(v, l);
		
		vector<It> k;
		k.reserve(20);
		for (int j = v; j >= 1; j /= 2)
			k.push_back(kk[j]);
		vector<pii> p1 = solve(vector<It>(k.begin(), k.begin() + sz(k)/2), l);
		vector<pii> p2 = solve(vector<It>(k.begin() + sz(k)/2, k.end()), l);

/*	cout << "1" << endl;
	for (auto p : p1) write(p.first, p.second);
	cout << "2" << endl;
	for (auto p : p2) write(p.first, p.second);
*/
		int ans = 0;

		auto it = prev(p2.end());
		for (auto p : p1) {
			while (it != p2.begiit->first + p.first > ll)
				--it;
			if (it == p2.end())
				continue;
			if (it->first + p.first > l)
				continue;
			chmax(ans, p.second + it->second);
		}

		write(ans);
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:85:41: error: 'class std::vector<std::pair<int, int> >' has no member named 'begiit'; did you mean 'begin'?
   85 |                         while (it != p2.begiit->first + p.first > ll)
      |                                         ^~~~~~
      |                                         begin
a.cc:85:69: error: expected primary-expression before ')' token
   85 |                         while (it != p2.begiit->first + p.first > ll)
      |                                                                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define FOR(i, a, b) for(int i = (int)a; i <= (int)b; i++)
#define DEC(i, a, b) for(int i = (int)a; i >= (int)b; i--)
typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef pair<pi, pi> pipi;
#define f first
#define s second
typedef vector<int> vi;
typedef vector<pi> vpi;
typedef vector<pii> vpii;
#define pb push_back
#define pf push_front
#define all(v) v.begin(), v.end()
#define INF (int) 1e9 + 100
#define LLINF (ll) 1e18
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

int n, q, a, b;
ll dp[30005][100005], v[30005], w[30005];

void dfs(int x) {
	int p = x/2;
	FOR(i, 0, 100000) dp[x][i] = dp[p][i];
	DEC(i, 100000, w[x]) dp[x][i] = max({dp[p][i-1], dp[p][i], dp[p][i-w[x]] + v[x]});
	if (2*x <= n) dfs(2*x);
	if (2*x < n) dfs(2*x+1);
}

int main() {
	fastio; cin >> n;
	FOR(i, 1, n) cin >> v[i] >> w[i];
	dfs(1);
	cin >> q;
	while (q--) {
		cin >> a >> b;
		cout << dp[a][b] << "\n";
	}
}


Compiler output:
/tmp/ccwc7nNq.o: in function `dfs(int)':
a.cc:(.text+0x102): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccwc7nNq.o
a.cc:(.text+0x13f): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccwc7nNq.o
a.cc:(.text+0x1a9): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccwc7nNq.o
/tmp/ccwc7nNq.o: in function `main':
a.cc:(.text+0x26c): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccwc7nNq.o
a.cc:(.text+0x298): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccwc7nNq.o
collect2: error: ld returned 1 exit status
Language: C++

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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------


int N;
int P[(1<<18)+1];
int D[1<<19];
int V[1<<19],W[1<<19];
int Q;
int T[1<<19],L[1<<19];
ll ret[1<<19];
vector<int> tar[1<<19];

vector<int> VV[1<<19];
vector<pair<int,ll>> cand[1<<19];

const int DI=12;


void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N;
	for(i=1;i<=N;i++) {
		if(i>1) {
			P[i]=i/2;
			D[i]=D[i/2]+1;
			VV[i]=VV[i/2];
		}
		VV[i].push_back(i);
		cin>>V[i]>>W[i];
		
	}
	cin>>Q;
	FOR(i,Q) {
		cin>>T[i]>>L[i];
		tar[T[i]].push_back(i);
	}
	
	
	
	for(i=1;i<1<<DI;i++) if(i<=N) {
		vector<pair<ll,ll>> A;
		int len=VV[i].size();
		int mask;
		FOR(mask,1<<len) {
			int v=0,w=0;
			FOR(j,len) if(mask&(1<<j)) v+=V[VV[i][j]],w+=W[VV[i][j]];
			if(w<=100000) A.push_back({w,v});
		}
		
		sort(ALL(A));
		cand[i].push_back({0,0});
		FORR(a,A) {
			while(cand[i].size() && cand[i].back().first==a.first) cand[i].pop_back();
			if(cand[i].empty() || cand[i].back().second<a.second) {
				cand[i].push_back(a);
			}
		}
		
		FORR(t,tar[i]) {
			x=lower_bound(ALL(cand[i]),make_pair(L[t]+1,0LL))-cand[i].begin();
			x--;
			ret[t]=cand[i][x].second;
		}
	}
	
	for(i=1<<DI;i<1<<18;i++) if(i<=N) {
		vector<int> C;
		int p=0;
		FORR(c,VV[i]) {
			if(D[c]>=DI) C.push_back(c);
			else p=max(p,c);
		}
		
		
		FORR(t,tar[i]) {
			int len=C[i].size();
			int mask;
			FOR(mask,1<<len) {
				int v=0,w=0;
				FOR(j,len) if(mask&(1<<j)) v+=V[C[j]],w+=W[C[j]];
				if(w<=L[t]) {
					x=lower_bound(ALL(cand[p]),make_pair(L[t]-w+1,0LL))-cand[p].begin();
					x--;
					ret[t]=max(ret[t],cand[p][x].second+v);
				}
			}
		}
		
	}
	
	
	
	FOR(i,Q) cout<<ret[i]<<endl;
	
	
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:89:38: error: request for member 'size' in 'C.std::vector<int>::operator[](((std::vector<int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   89 |                         int len=C[i].size();
      |                                      ^~~~
Language: C++

#pragma GCC optimize("Ofast",3,"inline")
#include<bits/stdc++.h>
using namespace std;
#define fir first
#define sec second
#define m_p make_pair
#define y1 ygftgfgcdtfgxffgx
#define y2 yfdsesgvtyghftfvv
#define x1 xvyr6cf6fgcfgf676
#define x2 xcr6rfc5r66y6r6fr
#define up_bound upper_bound
#define low_bound lower_bound
#define next_per next_permutation
#define pb push_back
#define i_to_s to_string
typedef priority_queue<int> p_queue;
typedef priority_queue<int, vector<int>, greater<int> > min_p_queue;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
int mon[20]={31,28,31,30,31,30,31,31,30,31,30,31};
ll gcd(ll x,ll y){return ((y==0)?x:gcd(y,x%y));}
inline int read(){
	int x=0;char ch=getchar();
	while(ch<'0'||ch>'9')ch=getchar();
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x;
}
using i64 = long long;

const int N = 300000 + 7;

int n, q;
int v[N], w[N];
i64 f[520][N];
int x, c = 100000;
int n, k, s, t, a[55];
long long C[55][55], ps[55][55];
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	scanf("%d%d%d%d", &n, &k, &s, &t);
	if ((s & t) != s || (s | t) != t) {
		puts("0");
		return 0;
	}
	for (int i = 1; i <= n; i++) {
		scanf("%d", &a[i]);
		if ((a[i] & s) != s || (a[i] | t) != t) {
			i--;
			n--;
		}
	}
	k = min(k, n);
	for (int i = C[0][0] = 1; i <= n; i++) {
		for (int j = C[i][0] = 1; j <= i; j++)
			C[i][j] = C[i - 1][j - 1] + C[i - 1][j];
		ps[i][1] = C[i][1];
		for (int j = 2; j <= i; j++) {
			ps[i][j] = ps[i][j - 1] + C[i][j];
		}
	}
	int fa = s ^ t;
	long long ans = 0;
	for (int mask = fa; ; mask = (mask - 1) & fa) {
		map<int, int> mp;
		for (int i = 1; i <= n; i++) {
			mp[a[i] & mask]++;
		}
		long long cur = 0;
		for (auto &it : mp) {
			cur += ps[it.second][min(k, it.second)];
		}
		if (__builtin_popcount(mask) & 1) ans -= cur;
		else ans += cur;
		if (!mask) break;
	}
	printf("%lld\n", ans);
	return 0;
}



Compiler output:
a.cc:38:5: error: redefinition of 'int n'
   38 | int n, k, s, t, a[55];
      |     ^
a.cc:34:5: note: 'int n' previously declared here
   34 | int n, q;
      |     ^
Language: C++

#include<bits/stdc++.h>
#define REP(i,n)for(ll i=0;i<n;i++)
#define MP make_pair
#define F first
#define S second
typedef long long ll;
using namespace std;
int main(){
    ll n,k,s,t,a[50];cin>>n>>k>>s>>t;
    REP(i,n)cin>>a[i];
    map<pair<ll,ll>,ll> dp[50];
    REP(i,n){
        for(ll j=k-2;j+1;j--){
            for(const auto&l:p[j]){
                dp[j+1][MP((l.F.F)&a[i],(l.F.S)|a[i])]+=(l.S);
            }
        }
        dp[0][MP(a[i],a[i])]=1;
    }
    n=0;
    REP(i,k)n+=(dp[i][MP(s,t)]);
    cout<<n;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:30: error: 'p' was not declared in this scope
   14 |             for(const auto&l:p[j]){
      |                              ^
Language: C++

#include<bits/stdc++.h>
#define REP(i,n)for(int i=0;i<n;i++)
#define FORD(i,a,b) for(int i=a;i>=(b);i--)
#define MP make_pair
#define F first
#define S second
using namespace std;
int main(){
    int n,k,s,t;cin >> n >> k >> s >> t;
    vector<int> b(n);REP(i,n)cin >> b[i];
    vector<int> a;
    REP(i,n){
        bool f=true;
        REP(j,18){
            if((s>>j)&1 and !((b[i]>>j)&1)){
                f=false;break;
            }
            if(!((t>>j)&1) and (b[i]>>j)&1){
                f=false;break;
            }
        }
        if(f)a.PB(b[i]);
    }
    n=SIZE(a);
    k=min(n,k);
    vector<map<pair<int,int>,int>> dp(k);
    REP(i,n){
        FORD(j,k-2,0){
            for(auto l=dp[j].begin();l!=dp[j].end();l++){
                dp[j+1][MP((l->F.F)&a[i],(l->F.S)|a[i])]+=(l->S);
            }
        }
        dp[0][MP(a[i],a[i])]=1;
    }
    int ans=0;
    REP(i,k)ans+=(dp[i][MP(s,t)]);
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:16: error: 'class std::vector<int>' has no member named 'PB'
   22 |         if(f)a.PB(b[i]);
      |                ^~
a.cc:24:7: error: 'SIZE' was not declared in this scope
   24 |     n=SIZE(a);
      |       ^~~~
Language: C++

#include<bits/stdc++.h>
#define REP(n)for(int i=0;i<n;i++)
#define FORD(i,a,b) for(int i=a;i>=(int)(b);i--)
#define MP make_pair
#define F first
#define S second
using namespace std;
int main(){
    int n,k,s,t,a[50];cin>>n>>k>>s>>t;
    REP(n)cin>>a[i];
    map<pair<int,int>,int>p[50];
    vector<map<pair<int,int>,int>> dp(k);
    REP(i,n){
        FORD(j,k-2,0){
            for(auto l=dp[j].begin();l!=dp[j].end();l++){
                dp[j+1][MP((l->F.F)&a[i],(l->F.S)|a[i])]+=(l->S);
            }
        }
        dp[0][MP(a[i],a[i])]=1;
    }
    int ans=0;
    REP(i,k)ans+=(dp[i][MP(s,t)]);
    cout << ans << endl;
}

Compiler output:
a.cc:13:12: error: macro "REP" passed 2 arguments, but takes just 1
   13 |     REP(i,n){
      |            ^
a.cc:2:9: note: macro "REP" defined here
    2 | #define REP(n)for(int i=0;i<n;i++)
      |         ^~~
a.cc:22:12: error: macro "REP" passed 2 arguments, but takes just 1
   22 |     REP(i,k)ans+=(dp[i][MP(s,t)]);
      |            ^
a.cc:2:9: note: macro "REP" defined here
    2 | #define REP(n)for(int i=0;i<n;i++)
      |         ^~~
a.cc: In function 'int main()':
a.cc:13:5: error: 'REP' was not declared in this scope
   13 |     REP(i,n){
      |     ^~~
a.cc:22:8: error: expected ';' before 'ans'
   22 |     REP(i,k)ans+=(dp[i][MP(s,t)]);
      |        ^    ~~~
      |        ;
Language: C++

#include<bits/stdc++.h>
#define REP(n)for(int i=0;i<n;i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define MP make_pair
#define F first
#define S second
using namespace std;
int main(){
    int n,k,s,t,a[50];cin>>n>>k>>s>>t;
    REP(n)cin>>a[i];
    map<pair<int,int>,int>p[50];
    vector<map<pair<ll,ll>,ll>> dp(k);
    REP(i,n){
        FORD(j,k-2,0){
            for(auto l=dp[j].begin();l!=dp[j].end();l++){
                dp[j+1][MP((l->F.F)&a[i],(l->F.S)|a[i])]+=(l->S);
            }
        }
        dp[0][MP(a[i],a[i])]=1;
    }
    ll ans=0;
    REP(i,k)ans+=(dp[i][MP(s,t)]);
    cout << ans << endl;
}

Compiler output:
a.cc:13:12: error: macro "REP" passed 2 arguments, but takes just 1
   13 |     REP(i,n){
      |            ^
a.cc:2:9: note: macro "REP" defined here
    2 | #define REP(n)for(int i=0;i<n;i++)
      |         ^~~
a.cc:22:12: error: macro "REP" passed 2 arguments, but takes just 1
   22 |     REP(i,k)ans+=(dp[i][MP(s,t)]);
      |            ^
a.cc:2:9: note: macro "REP" defined here
    2 | #define REP(n)for(int i=0;i<n;i++)
      |         ^~~
a.cc: In function 'int main()':
a.cc:12:21: error: 'll' was not declared in this scope
   12 |     vector<map<pair<ll,ll>,ll>> dp(k);
      |                     ^~
a.cc:12:26: error: template argument 1 is invalid
   12 |     vector<map<pair<ll,ll>,ll>> dp(k);
      |                          ^
a.cc:12:28: error: template argument 1 is invalid
   12 |     vector<map<pair<ll,ll>,ll>> dp(k);
      |                            ^~
a.cc:12:28: error: template argument 3 is invalid
a.cc:12:28: error: template argument 4 is invalid
a.cc:12:30: error: template argument 1 is invalid
   12 |     vector<map<pair<ll,ll>,ll>> dp(k);
      |                              ^~
a.cc:12:30: error: template argument 2 is invalid
a.cc:13:5: error: 'REP' was not declared in this scope
   13 |     REP(i,n){
      |     ^~~
a.cc:21:7: error: expected ';' before 'ans'
   21 |     ll ans=0;
      |       ^~~~
      |       ;
a.cc:22:8: error: expected ';' before 'ans'
   22 |     REP(i,k)ans+=(dp[i][MP(s,t)]);
      |        ^    ~~~
      |        ;
a.cc:23:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...)
#endif

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, k, s, t;
    cin >> n >> k >> s >> t;
    vector<int> a;
    for (int i = 0; i < n; i++) {
        int b;
        cin >> b;
        if ((b & s) == s && (b | t) == t) {
            a.emplace_back(b);
        }
    }
    if ((t & s) != s) {
        cout << 0 << '\n';
        return 0;
    }
    debug(a);
    ll ans = 0;
    n = a.size();
    vector<vector<ll>> C(n + 1, vector<ll>(n + 1));
    for (int i = 0; i <= n; i++) {
        C[i][0] = 1;
        for (int j = 1; j <= i; j++) {
            C[i][j] = C[i - 1][j] + C[i - 1][j - 1];
        }
    }
    vector<ll> w(n + 1);
    for (int i = 0; i <= n; i++) {
        for (int j = 1; j <= min(k, i); j++) {
            w[i] += C[i][j];
        }
    }
    for (int i = 0; i < (1 << 18); i++) {
        if ((s & i) != s || (t | i) != t) {
            continue;
        }
        ll sgn = 1;
        if (__builtin_popcount(i) % 2 == 1) {
            sgn = -1;
        }
        vector<int> b(n);
        for (int j = 0; j < n; j++) {
            b[j] = a[j] & i;
        }
        sort(b.begin(), b.end());

        for (int j = 0; j < n; j++) {
            int l = j;
            while (j + 1 < n && b[j] == b[j + 1]) {
                j++;
            }
            ans += sgn * w[j - l + 1];
        }
    }
    cout << abs(ans << '\n';
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:65:28: error: expected ')' before ';' token
   65 |     cout << abs(ans << '\n';
      |                ~           ^
      |                            )
Language: C++

#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
#define ALL(a) a.begin(), a.end()
#define fi first
#define se second
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

ll N,M,H,W,Q,K,A,B;
string S;
const ll MOD = 998244353;
//const ll MOD = (1e+9) + 7;
typedef pair<ll, ll> P;
const ll INF = (1LL<<62);

int main() {
    ll L;
    cin>>N>>K>>L>>H;
    if((L&H) != L || (L|H) != H){
        cout<<0<<endl;
        return 0;
    }
    vec a(0);
    rep(i,N){
        cin>>A;
        if((L&A) == L && (A|H) == H) a.push_back(A);
    }
    N = a.size();
    if(N == 0){
        cout<<0<<endl;
        return 0;
    }
    vec solve(N + 1);
    solve[0] = 0;
    reps(i,1,min(N, K) + 1) solve[i] = (1LL<<(i - 1));
    
    int len = 18;
    rep(i,18){
        if((L>>i)&1 || !((H>>i)&1)){
            --len;
            ll temp = (1<<i);
            rep(j,N) a[i] = (a[i] / (temp * 2)) * temp + (a[i] % temp);
            L = (L / (temp * 2)) * temp + (L % temp);
            H = (H / (temp * 2)) * temp + (H % temp);
        }
    }
    vec dp(1LL<<len);
    ll res = 0;
    rep(s, 1LL<<len){
        if(s == 0){
            res = (1LL<<N);
        }else{
            vec bit(0);
            rep(i,len) if((s>>i)&1) bit.push_back(i);
            int bsz = bit.size();
            ll res_num = 0;
            if(bsz < 8){
                rep(t, 1<<bsz){
                    ll howmany = 0;
                    rep(i,N){
                        bool ok = true;
                        rep(j,bsz){
                            if(((a[i]>>bit[j])&1) != ((s>>bit[j])&1)){
                                ok = false;
                                break;
                            }
                        }
                        if(ok) ++howmany;
                    }
                    res_num += solve(howmany);
                }
            }else{
                for(ll t : a){
                    ll howmany = 0;
                    bool ok = true;
                    rep(i,N){
                        bool ok = true;
                        rep(j,bsz){
                            if(((a[i]>>bit[j])&1) != ((s>>bit[j])&1)){
                                ok = false;
                                break;
                            }
                        }
                        if(ok) ++howmany;
                    }
                    res_num += solve(howmany);
                }
            }
            res += (bsz&1 ? -res_num : res_num);
        }
    }
    cout<<res<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:76:37: error: no match for call to '(vec {aka std::vector<long long int>}) (ll&)'
   76 |                     res_num += solve(howmany);
      |                                ~~~~~^~~~~~~~~
a.cc:92:37: error: no match for call to '(vec {aka std::vector<long long int>}) (ll&)'
   92 |                     res_num += solve(howmany);
      |                                ~~~~~^~~~~~~~~
Language: C++

//#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>

#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define bit(n,k) (((ll)n>>(ll)k)&1) /*nのk bit目*/
#define pb push_back
const long long INF= 1e+18+1;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
const ll MOD=1000000007LL;
//const ll MOD=998244353LL;
//const ll MOD=1777777777LL;
//const ll MAX_V=114514LL;
//const ll MAX = 500010LL;
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
vl dx={-1,-1,-1,0,0,1,1,1};
vl dy={1,-1,0,1,-1,1,0,-1};




int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  cout << fixed << setprecision(10);
  /*--------------------------------*/
  ll n,k,s,t;cin>>n>>k>>s>>t;
  vl a(n);
  rep(i,n)cin>>a[i];
  vl finished(18);
  rep(bi,18){
    if(bit(s,bi)){
      finished[bi]=1;
      rep(i,n){
        if(!bit(a[i],bi)){
          a[i]=-1;
        }
      }
    }
    if(!bit(t,bi)){
      if(finished[bi]){
        cout<<0<<endl;
        return 0;
      }
      finished[bi]=1;
      rep(i,n){
        if(bit(a[i],bi)){
          a[i]=-1;
        }
      }
    }
  }
  /*rep(i,n)cout<<a[i]<<" ";
  cout<<endl;
  rep(i,18)cout<<finished[i]<<" ";
  cout<<endl;
  */
  vl na;
  rep(i,n){
    if(a[i])na.pb(a[i]);
  }
  ll nn=na.size();
  rep(i,nn){
    ll base=na[i];
    vl dp(1LL<<18);
    dp[0]=1;
    for(ll j=i+1;j+i<nn;j++){
      dp[na[j]] 
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:74:16: error: expected ';' before '}' token
   74 |       dp[na[j]]
      |                ^
      |                ;
   75 |     }
      |     ~           
a.cc:74:15: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = long long int; _Alloc = std::allocator<long long int>; reference = long long int&; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
   74 |       dp[na[j]]
      |               ^
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:1128:7: note: declared here
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
Language: C++

#include <bits/stdc++.h>

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)


using namespace std;

using ll=long long;

using pii = pair<int, int>;

struct HashPair {

    static size_t m_hash_pair_random;

    template<class T1, class T2>
    size_t operator()(const pair<T1, T2> &p) const {

        auto hash1 = hash<T1>{}(p.first);
        auto hash2 = hash<T2>{}(p.second);

        size_t seed = 0;
        seed ^= hash1 + 0x9e3779b9 + (seed << 6) + (seed >> 2);
        seed ^= hash2 + 0x9e3779b9 + (seed << 6) + (seed >> 2);
        seed ^= m_hash_pair_random + 0x9e3779b9 + (seed << 6) + (seed >> 2);
        return seed;
    }
};

unordered_map<pii, ll, HashPair> dp[55][55];

int main(void){
	int n, k, s, t;
	cin >> n >> k >> s >> t;
	vector<int> a;

	rep(i, n) {
		int elem;
		cin >> elem;
		if((s & elem) != s) continue;
		if((t | elem) != t) continue;
		a.push_back(elem);
	}

	n = a.size();
	const int all = 1 << 18;

	dp[0][0][pii(all - 1, 0)] = 1LL;

	rep(i, n)rep(j, k + 1) {
		for(auto &elem: dp[i][j]) {
			const pii mask = elem.first;
			const ll val = elem.second;
			dp[i + 1][j][mask] += val;
			pii nmask = mask;
			nmask.first &= a[i];
			nmask.second |= a[i];
			dp[i + 1][j + 1][nmask] += val;
		}
	}
			
	ll ans = 0LL;
	rep(j, 1, k + 1) ans += dp[n][j][pii(s, t)];
	cout << ans << endl;

	return 0;
}

Compiler output:
/usr/bin/ld: /tmp/cc1FzeKQ.o: warning: relocation against `_ZN8HashPair18m_hash_pair_randomE' in read-only section `.text._ZNK8HashPairclIiiEEmRKSt4pairIT_T0_E[_ZNK8HashPairclIiiEEmRKSt4pairIT_T0_E]'
/usr/bin/ld: /tmp/cc1FzeKQ.o: in function `unsigned long HashPair::operator()<int, int>(std::pair<int, int> const&) const':
a.cc:(.text._ZNK8HashPairclIiiEEmRKSt4pairIT_T0_E[_ZNK8HashPairclIiiEEmRKSt4pairIT_T0_E]+0xa9): undefined reference to `HashPair::m_hash_pair_random'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <sstream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <string>
#include <cstring>
#include <bitset>
#include <functional>
#include <random>
#define REP(_i,_a,_n) for(int _i=_a;_i<=_n;++_i)
#define PER(_i,_a,_n) for(int _i=_n;_i>=_a;--_i)
#define hr putchar(10)
#define pb push_back
#define lc (o<<1)
#define rc (lc|1)
#define mid ((l+r)>>1)
#define ls lc,l,mid
#define rs rc,mid+1,r
#define x first
#define y second
#define io std::ios::sync_with_stdio(false)
#define endl '\n'
#define DB(_a) ({REP(_i,1,n) cout<<_a[_i]<<',';hr;})
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int P = 1e9+7, INF = 0x3f3f3f3f;
ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
ll qpow(ll a,ll n) {ll r=1%P;for (a%=P;n;a=a*a%P,n>>=1)if(n&1)r=r*a%P;return r;}
ll inv(ll x){return x<=1?1:inv(P%x)*(P-P/x)%P;}
inline int rd() {int x=0;char p=getchar();while(p<'0'||p>'9')p=getchar();while(p>='0'&&p<='9')x=x*10+p-'0',p=getchar();return x;}
//head



#ifdef __APPLE__
const int N = 1e2+50;
#else
const int N = 1e6+50;
#endif


int n,k,ans,a[N],S,T;
map<pair<int,pair<int,int>>,ll> mp;
queue<pair<pair<int,pair<int,int>>,ll>> q;

int main() {
	scanf("%d%d%d%d",&n,&k,&S,&T);
	REP(i,0,n-1) { 
		scanf("%d",a+i);
		if ((a[i]|T)!=T) --i,--n;
		else if ((a[i]|S)!=a[i]) --i,--n;
	}
	if (!n) return puts("0"),0;
	ll x = a[0], y = a[0];
	REP(i,1,n-1) x&=a[i], y|=a[i];
	if (y!=T) return puts("0"),0;
	if ((x|S)!=S) return puts("0"),0;
	REP(i,0,n-1) {
		for (auto &t:mp) {
			pair<int,pair<int,int>> u = t.x;
			u.y.x&=a[i],u.y.y|=a[i];
			if (++u.x<=k) q.push({u,t.y});
		}
		while (q.size()) {
			auto t = q.front(); q.pop();
			mp[t.x] += t.y;
		}
		++mp[{1,{a[i],a[i]}];
	}
	ll ans = 0;
	REP(i,1,k) ans+=mp[{1,{S,T}}];
	printf("%lld\n", ans);
}



Compiler output:
a.cc: In function 'int main()':
a.cc:73:36: error: expected '}' before ']' token
   73 |                 ++mp[{1,{a[i],a[i]}];
      |                      ~             ^
Language: C++

50 3 0 262143
3 1 2 3 1
262143 1 2 3 1
3 1 2 3 1
3 1 2 3 1
3 1 2 3 1
3 1 2 3 1
3 1 2 3 1
3 1 2 3 1
3 1 2 3 1
3 1 2 3 1


Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 50 3 0 262143
      | ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...)
#endif

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, k, s, t;
    cin >> n >> k >> s >> t;
    vector<int> a;
    vector<int> x;
    for (int i = 0; i < 18; i++) {
        if (s & (1 << i)) {
            if (t & (1 << i)) {
                t ^= 1 << i;
            } else {
                cout << 0 << '\n';
                return 0;
            }
        }
        if (t & (1 << i)) {
            x.emplace_back(i);
        }
    }
    int id = -1;
    vector<vector<int>> st(x.size());
    int all = 0;
    for (int i = 0; i < n; i++) {
        int b;
        cin >> b;
        if ((b | s) == b) {
            if ((b | t) != t) {
                continue;
            }
            if (b == t) {
                all++;
                continue;
            }
            id++;
            int c = 0;
            for (int j = 0; j < x.size(); j++) {
                c *= 2;
                if (b & (1 << x[j])) {
                    st[j].emplace_back(id);
                    c++;
                }
            }
            a.emplace_back(c);
        }
    }
    int m = x.size();
    int n = a.size();
    vector<vector<ll>> dp(k + 1, vector<ll>(1 << m));
    dp[0][0] = 1;
    for (int i = k; i >= 0; i--) {
        for (int j = 0; j < (1 << m); j++) {
            for (int k = 0; k < n; k++) {
                dp[i + 1][j | a[k]] += dp[i][j];
            }
        }
    }
    ll ans = 0;
    for (int i = k; i >= 0; i--) {
        for (int j = 0; j <= all; j++) {
            if (i + j <= k) {
                ans += dp[i][(1 << m) - 1];
            }
        }
    }
    cout << ans << '\n';
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:57:9: error: redeclaration of 'int n'
   57 |     int n = a.size();
      |         ^
a.cc:13:9: note: 'int n' previously declared here
   13 |     int n, k, s, t;
      |         ^
Language: C++

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

int main() {
    int n,k,s,t;
    cin >> n >> k >> s >> t;
    
    vector<int> _data(n);
    vector<int> data;

    for(int i = 0 ; i < n ; i++){
        cin >> _data.at(i);
        if( ((_data.at(i) & s) == s) && ((_data.at(i) | t) == t) ){
            data.push_back(_data.at(i));
        }
    }

    if(s == t){
        cout << data.size() << endl;
        return 0;
    }
    if((s & ^t) != 0){
        cout << 0 << endl;
        return 0;
    }

    int64_t result = 0;

    int64_t tempo = 0, tempa = s;
    for(int i = 0 ; i < data.size() ; i++){
        tempo |= data.at(i);
        tempa &= data.at(i);
    }
    if((tempo != t) || (tempa != s)){
        cout << 0 << endl;
        return 0;
    }

    for(int j = 2 ; j <= data.size() ; j++){
        
    }
    cout << data.size() << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:13: error: expected primary-expression before '^' token
   22 |     if((s & ^t) != 0){
      |             ^
Language: C++

#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>

using namespace std;

using ll = long long;

int main() {
   ios_base::sync_with_stdio(false); cin.tie(nullptr);
   int N, K, S, T;
   cin >> N >> K >> S >> T;
   if ((S & T) != S) {
      cout << 0;
      return 0;
   }
   vector<int> A(N);
   for (int i = 0; i < N; ++i) cin >> A[i];
   vector<int> cnt(1 << 18);
   for (int i = 0; i < N; ++i) {
      if ((A[i] & S) != S) continue;
      if ((A[i] | T) != T) continue;
      ++cnt[A[i]];
   }
   vector<int> up_cnt = cnt;
   vector<int> down_cnt = cnt;
   for (int i = 0; i < 18; ++i) {
      for (int j = 0; j < (1 << 18); j += (1 << (i + 1))) {
         up_cnt[j + (1 << i)] += up_cnt[j];
         down_cnt[j] += down_cnt[j + (1 << i)];
      }
   }
   vector<int> bits;
   vector<char> state(18);
   for (int i = 0; i < 18; ++i) {
      if (S & (1 << i)) state[i] = 1;
      else if (T & (1 << i)) state[i] = 2;
   }
   // cerr << "clgt\n";
   vector<ll> cf(N + 1);
   function<void(int, int, int, int)> brute = [&](int i, int cnt, int orv, int andv) {
      if (i == 18) {
         int q = 0;
         for (int z : A) q += ((z & andv) == andv) && ((z | orv) == orv);
         cf[q] += (cnt & 1) ? -1 : +1;
         return;
      }
      if (state[i] == 0) {
         brute(i + 1, cnt, orv, andv);
      } else if (state[i] == 1) {
         brute(i + 1, cnt, orv + (1 << i), andv + (1 << i));
      } else {
         brute(i + 1, cnt + 1, orv, andv);
         brute(i + 1, cnt + 1, orv + (1 << i), andv + (1 << i));
         brute(i + 1, cnt, orv + (1 << i), andv);
      }
   };
   brute(0, 0, 0, 0);
   vector<vector<ll>> C(N + 1, vector<ll>(N + 1));
   for (int i = 0; i <= N; ++i) {
      C[i][0] = 1;
      for (int j = 1; j <= i; ++j) C[i][j] = C[i - 1][j] + C[i - 1][j - 1];
   }
   ll ans = 0;
   for (int q = 1; q <= N; ++q) {
      ll z = cf[q];
      for (int i = 1; i <= K; ++i) ans += z * C[q][i];
   }
   cout << ans << "\n";
}


Compiler output:
In file included from /usr/include/c++/14/string:43,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:5:
/usr/include/c++/14/bits/allocator.h: In destructor 'std::_Vector_base<int, std::allocator<int> >::_Vector_impl::~_Vector_impl()':
/usr/include/c++/14/bits/allocator.h:182:7: error: inlining failed in call to 'always_inline' 'std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = int]': target specific option mismatch
  182 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:132:14: note: called from here
  132 |       struct _Vector_impl
      |              ^~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define R register
#define mp make_pair
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
using namespace std;
const int mod = 998244353;

int n, k, s, t, a[100], m, num;
ll bs[100], comb[100][100], f[100], ans, rbs[100];
vector<int> tr;

inline int addMod(int a, int b) {
	return (a += b) >= mod ? a - mod : a;
}

inline ll quickpow(ll base, ll pw) {
	ll ret = 1;
	while (pw) {
		if (pw & 1) ret = ret * base % mod;
		base = base * base % mod, pw >>= 1;
	}
	return ret;
}

template <class T>
inline void read(T &x) {
	x = 0;
	char ch = getchar(), w = 0;
	while (!isdigit(ch)) w = (ch == '-'), ch = getchar();
	while (isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
	x = w ? -x : x;
	return;
}

void dfs(ll now, int step, int val) {
	if (!now) return;
	if (step == num) {
		ans += val * f[_popcnt32(now) + _popcnt32(now >> 32)];
		return;
	}
	dfs(now, step + 1, val);
	dfs(now & bs[step], step + 1, -val);
	dfs(now & rbs[step], step + 1, -val);
	return;
}

int main() {
	read(n), read(k), read(s), read(t);
	if ((s & t) != s) {
		cout << "0\n";
		return 0;
	}
	for (R int j = 0; j <= 18; ++j) {
		if ((s & (1 << j)) || (~t & (1 << j))) continue;
		tr.push_back(j), ++num;
	}
	for (R int i = 1; i <= n; ++i) {
		read(a[i]);
		if ((a[i] & s) != s || (a[i] & t) != a[i])
			continue;
		for (R int j = 0; j < num; ++j)
			if (a[i] & (1 << tr[j]))
				bs[j] |= 1 << m;
		++m;
	}
	for (R int i = 0; i < num; ++i)
		rbs[i] = ((1 << m) - 1) ^ bs[i];
	for (R int i = 0; i <= m; ++i) {
		comb[i][0] = 1;
		for (R int j = 1; j <= i; ++j) {
			comb[i][j] = comb[i - 1][j - 1] + comb[i - 1][j];
			if (j <= k) f[i] += comb[i][j];
		}
	}
	dfs((1ll << m) - 1, 0, 1);
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'void dfs(long long int, int, int)':
a.cc:40:32: error: '_popcnt32' was not declared in this scope
   40 |                 ans += val * f[_popcnt32(now) + _popcnt32(now >> 32)];
      |                                ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:55:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   55 |         for (R int j = 0; j <= 18; ++j) {
      |                    ^
a.cc:59:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   59 |         for (R int i = 1; i <= n; ++i) {
      |                    ^
a.cc:63:28: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   63 |                 for (R int j = 0; j < num; ++j)
      |                            ^
a.cc:68:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   68 |         for (R int i = 0; i < num; ++i)
      |                    ^
a.cc:70:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   70 |         for (R int i = 0; i <= m; ++i) {
      |                    ^
a.cc:72:28: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   72 |                 for (R int j = 1; j <= i; ++j) {
      |                            ^
Language: C++

#include <bits/stdc++.h>
#define R register
#define mp make_pair
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
using namespace std;
const int mod = 998244353;

int n, k, s, t, a[100], m, num;
ll bs[100], comb[100][100], f[100], ans, rbs[100];
vector<int> tr;

inline int addMod(int a, int b) {
	return (a += b) >= mod ? a - mod : a;
}

inline ll quickpow(ll base, ll pw) {
	ll ret = 1;
	while (pw) {
		if (pw & 1) ret = ret * base % mod;
		base = base * base % mod, pw >>= 1;
	}
	return ret;
}

template <class T>
inline void read(T &x) {
	x = 0;
	char ch = getchar(), w = 0;
	while (!isdigit(ch)) w = (ch == '-'), ch = getchar();
	while (isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
	x = w ? -x : x;
	return;
}

void dfs(ll now, int step, int val) {
	if (!now) return;
	if (step == num) {
		ans += val * f[_popcnt(now) + _popcnt(now >> 32)];
		return;
	}
	dfs(now, step + 1, val);
	dfs(now & bs[step], step + 1, -val);
	dfs(now & rbs[step], step + 1, -val);
	return;
}

int main() {
	read(n), read(k), read(s), read(t);
	if ((s & t) != s) {
		cout << "0\n";
		return 0;
	}
	for (R int j = 0; j <= 18; ++j) {
		if ((s & (1 << j)) || (~t & (1 << j))) continue;
		tr.push_back(j), ++num;
	}
	for (R int i = 1; i <= n; ++i) {
		read(a[i]);
		if ((a[i] & s) != s || (a[i] & t) != a[i])
			continue;
		for (R int j = 0; j < num; ++j)
			if (a[i] & (1 << tr[j]))
				bs[j] |= 1 << m;
		++m;
	}
	for (R int i = 0; i < num; ++i)
		rbs[i] = ((1 << m) - 1) ^ bs[i];
	for (R int i = 0; i <= m; ++i) {
		comb[i][0] = 1;
		for (R int j = 1; j <= i; ++j) {
			comb[i][j] = comb[i - 1][j - 1] + comb[i - 1][j];
			if (j <= k) f[i] += comb[i][j];
		}
	}
	dfs((1ll << m) - 1, 0, 1);
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'void dfs(long long int, int, int)':
a.cc:40:32: error: '_popcnt' was not declared in this scope; did you mean 'popen'?
   40 |                 ans += val * f[_popcnt(now) + _popcnt(now >> 32)];
      |                                ^~~~~~~
      |                                popen
a.cc: In function 'int main()':
a.cc:55:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   55 |         for (R int j = 0; j <= 18; ++j) {
      |                    ^
a.cc:59:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   59 |         for (R int i = 1; i <= n; ++i) {
      |                    ^
a.cc:63:28: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   63 |                 for (R int j = 0; j < num; ++j)
      |                            ^
a.cc:68:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   68 |         for (R int i = 0; i < num; ++i)
      |                    ^
a.cc:70:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   70 |         for (R int i = 0; i <= m; ++i) {
      |                    ^
a.cc:72:28: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   72 |                 for (R int j = 1; j <= i; ++j) {
      |                            ^