# Zoo [csp2020]

2020-11-09 19:33:36 AK_DREAM

### Topic

https://www.luogu.com.cn/problem/P7076

This should be the most signed in question

Feed is common \(c\) Kind of ,1e8 There is no room for , First, the feed number should be re labeled

Note that there is no need to discretize ( Sort and de duplicate ), because \(q_i\) Different from each other , So just put the number \(i\) The number of the feed is regarded as \(i\) that will do ( What is the sign in question )

First of all, for existing animals , Deal with it first \(K\) Which of the animals is 1

Then scan through all the requirements to find out which feed to buy

Finally, scan all the requirements again and work out \(K\) Which of the bits can be 1

Suppose there is \(x\) It can be 1, The answer is \(2^x-n\)

Be careful ：

1. The answer may explode `long long` need `unsigned long long`
2. If \(n=m=0,k=64\), So the answer is \(2^64\), Explosive `unsigned long long`... Special judgment required

It feels like 2 Hang up 5pts...

``````#include <bits/stdc++.h>
#define N 1000005
using namespace std;
typedef unsigned long long ull;

template <typename T>
T x = 0; char ch = getchar();
for (; ch > '9' || ch < '0'; ch = getchar());
for (; ch <= '9' && ch >= '0'; ch = getchar()) x = (x << 3) + (x << 1) + (ch ^ '0');
num = x;
}

int n, m, c, k, p[N];
ull a[N], S, ans, fst;

for (int i = 1; i <= m; i++) {
}
}
void solveans() {
for (int i = 0; i < k; i++) ok[i] = 1;
for (int i = 1; i <= m; i++) {
}
int cnt = 0;
for (int i = 0; i < k; i++) if (ok[i]) cnt++;
ans = (1ull << cnt) - n;
}

int main() {
if (!n && !m && k == 64) {
puts("18446744073709551616");
return 0;
}
for (int i = 1; i <= n; i++) {
}
for (int i = 1; i <= m; i++) {
}
solveans();
cout << ans << endl; //%lld It doesn't seem very good
return 0;
}
``````