Pagini recente » Cod sursa (job #1915131) | Cod sursa (job #2042317) | Cod sursa (job #3282959) | Cod sursa (job #737980) | Cod sursa (job #2206449)
#include <iostream>
#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 ("%lld", &x);
while (x and not x & 1) {
x >>= 1;
}
if (x) {
s.insert (x);
}
}
int q;
scanf ("%d", &q);
int cnt = 0;
while (q --) {
scanf ("%lld", &x);
while (x and not x & 1) {
x >>= 1;
}
if (x and s.find (x) != s.end ()) {
++ cnt;
}
}
printf ("%d\n", cnt);
}