Cod sursa(job #2206436)
Utilizator | Data | 22 mai 2018 18:21:08 | |
---|---|---|---|
Problema | Dtcsu | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.5 kb |
#include <cstdio>
#include <unordered_set>
using namespace std;
int main () {
freopen ("dtcsu.in", "r", stdin);
freopen ("dtcsu.out", "w", stdout);
unordered_set < long long > s;
int k = 276997;
long long x;
while (k --) {
scanf ("%ld", &x);
if (x & 1) {
s.insert (x);
}
}
int q;
scanf ("%d", &q);
int cnt = 0;
while (q --) {
scanf ("%ld", &x);
if (x and s.find (x / (x & -x)) != s.end ()) {
++ cnt;
}
}
printf ("%d\n", cnt);
}