General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
101840505 Practice:
luogu_bot3
449D - 22 GNU C++11 Accepted 795 ms 39144 KB 2020-12-20 13:45:21 2020-12-20 13:45:21
→ Source
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7 - 1 + 1;
int n;
ll m;
ll inv2;
ll F[2000005], G[2000005], zsy[1000005];
int k;
void FMT(ll *f, ll op) {
	for (int i = 1; i < (1 << k); i <<= 1) {
		for (int j = 0; j < (1 << k); j++) {
			if (!(j & i)) {
				f[j] = ((f[j] + f[j | i] * op) % mod + mod) % mod;
			}
		}
	}
}
ll ksm(ll a, ll b) {
	ll ret = 1;
	while (b) {
		if (b & 1) ret = ret * a % mod;
		a = a * a % mod;
		b >>= 1;
	}
	return ret;
}
int main() {
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) scanf("%lld", &zsy[i]), m = max(m, zsy[i]);
	inv2 = (mod - mod / 2) % mod;
	k = log(m) / log(2);
	k++;
	for (int i = 1; i <= n; i++) G[zsy[i]]++;
	FMT(G, 1);
	for (int i = 0; i < (1 << k); i++) F[i] = ksm(2, G[i]) - 1;
	FMT(F, -1);
	printf("%lld\n", F[0]);
	return 0;
}
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details