60 pts , WA on #15~#22 , hack 通过
link : https://www.luogu.com.cn/record/226660138
code :
#include<bits/stdc++.h>
typedef long long int ll;
using namespace std;
const int maxn=1e6+10;
int n,m,c,k,a[maxn],x,sum;
map<int,int>mp;
unsigned long long ksm(int a,int b){
unsigned long long mul=1;
while(b){
if(b&1)mul*=a,b--;
a*=a,b>>=1;
}
return mul;
}
int main(){
cin>>n>>m>>c>>k;
for(int i=0;i<n;i++)cin>>a[i];
while(m--){
int p,q;
cin>>p>>q;
mp[p]=1;
}
for(int i=0;i<n;i++)x|=a[i];
for(int i=0;i<k;i++)if(!(x&(1<<i))&&mp[i])sum++;
cout<<ksm(2,k-sum)-n;
return 0;
}