Pagini recente » Cod sursa (job #1252652) | Cod sursa (job #1305491) | Cod sursa (job #889445) | Cod sursa (job #2885188) | Cod sursa (job #2300547)
#include <bits/stdc++.h>
using namespace std;
ifstream in("dtcsu.in");
ofstream out("dtcsu.out");
typedef unsigned long long int ull;
unordered_set< ull > uSet;
int main() {
ios::sync_with_stdio(false); in.tie(0); out.tie(0);
for (int i = 1; i <= 276997; ++i) {
ull nr; in >> nr;
if (nr % 2LL != 0LL) {
uSet.insert(nr);
}
}
ull ans = 0;
int Q; in >> Q;
while (Q--) {
ull n; in >> n;
if (n % 2LL == 0LL) {
if ((n & (-n)) != 0) {
n /= (n & (-n));
}
}
if (uSet.find(n) != uSet.end()) {
++ans;
}
}
out << ans << "\n";
in.close(); out.close();
return 0;
}