95pts求助
查看原帖
95pts求助
344633
oneton429楼主2020/11/12 21:52

错#17, 同这个

数据点

#include <cstdio>
#include <cctype>
#define N 1000010

template <class I> inline void read(I & x) {
	x = 0;
	int w = 1;
	char c = ' ';
	while (!isdigit(c) && c != '-') c = getchar();
	if (c == '-') c = getchar(), w *= -1;
	while (isdigit(c)) x = x * 10 + (c ^ 48), c = getchar();
	x *= w;
}

template<class I> inline void read(I & a, I & b) {read(a), read(b);}
template<class I> inline void read(I & a, I & b, I & c) {read(a, b), read(c);}

unsigned long long n, m, c, k, cnt;
unsigned long long ani, t;
bool chuxian[100];
unsigned long long rem;

int main(void) {
	//freopen("zoo.in", "r", stdin);
//	freopen("zoo.out", "w", stdout);
	read(n, m), read(c, k);
    if(n == 0 && m == 0 && k == 64){
        printf("18446744073709551616");
        return 0;
    }
	for (int i = 1; i <= n; ++i)
		read(t), 
		ani |= t;
	for (int i = 1, p, q; i <= m; ++i) {
		read(p, q);
		if (ani & ((unsigned long long)(1) << p))
			continue;
		if (!chuxian[p])
			++cnt,
			chuxian[p] = true;
	}
	rem = ((unsigned long long)(1) << (k - cnt)) - n;
	printf("%llu\n", rem);
	return 0;
}
2020/11/12 21:52
加载中...