tgT2,70分求助
  • 板块学术版
  • 楼主nuo0930
  • 当前回复1
  • 已保存回复1
  • 发布时间2020/11/8 10:35
  • 上次更新2023/11/5 08:30:31
查看原帖
tgT2,70分求助
335627
nuo0930楼主2020/11/8 10:35
#include<iostream>
#include<fstream>
using namespace std;
unsigned long long a[1000010];
unsigned long long x=0,y=1;
int main() {
//	freopen("zoo.in","r",stdin);
//	freopen("zoo.out","w",stdout);
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int n,m;
	cin>>n>>m;
	int c,k;
	cin>>c>>k;
	for(int i=1;i<=n;i++)
		cin>>a[i];
	for(int i=1;i<=m;i++) {
		int p,q;
		cin>>p>>q;
		if(x/(1<<p)%2==0)
			x+=(1<<p);
	}
	for(int i=1;i<=n;i++) 
		x&=~a[i];
//	cout<<x<<' ';
	x=~x;
	if(x==0xffffffffffffffff&&k==64) {
		cout<<0xffffffffffffffff-n+1;
		return 0;
	}
	while(k--) {
		y*=x%2+1;
//		cout<<x%2+1<<' ';
		x>>=1;
//		cout<<y<<'\n';
	}
//	cout<<0xffffffffffffffff;
	cout<<y-n;
	return 0;
}
2020/11/8 10:35
加载中...