Pagini recente » Cod sursa (job #1224059) | Diferente pentru moisil-2015 intre reviziile 8 si 7 | Cod sursa (job #2371190) | Cod sursa (job #1944858) | Cod sursa (job #1038508)
#include <fstream>
#include <unordered_set>
using namespace std;
unordered_set <long long> s;
const int dim = 276997;
ifstream fin("dtcsu.in");
ofstream fout("dtcsu.out");
int main() {
for (int i = 1; i <= dim; ++i) {
long long a; fin >> a;
if (a % 2 != 0)
s.insert(a);
}
int q, rez = 0; fin >> q;
for (int i = 1; i <= q; ++i) {
long long a; fin >> a;
while (a % 2 == 0) a /= 2;
if (s.find(a) != s.end()) ++rez;
}
fout << rez;
return 0;
}