5分求条
查看原帖
5分求条
1260767
mixue_bc楼主2025/8/1 12:19
#include<bits/stdc++.h>
//#pragma GCC optimize(2)
#define unsigned long long
#define INF LLONG_MAX
#define ios ios::sync_with_stdio(0),cout.tie(0),cin.tie(0);
using namespace std;
inline int read(){ int x=0,f=1;char ch=getchar();while(ch<'0'||ch>'9'){ if(ch=='-')f=-1;ch=getchar(); }while(ch>='0'&&ch<='9'){ x=x*10+ch-48;ch=getchar(); }return x*f; }
const int N=0;
int n,m,c,k,a,p,q,res,g;
bool f[1145];
signed main(){
    ios
    cin>>n>>m>>c>>k;
    res=k;
    if(!n&&!m&&k==64){
        cout<<"18446744073709551616";
        return 0;
    }
    for(int i=1;i<=n;i++){
        cin>>a;
        g|=a;
    }
    for(int i=1;i<=m;i++){
        cin>>p>>q;
        if(!((g>>p)&1)&&!f[p])res--,f[p]=1;
    }
    cout<<(res<<1)-n;
    return 0;
}
2025/8/1 12:19
加载中...