Pagini recente » Cod sursa (job #788812) | Cod sursa (job #2404098) | template/inscriere | Cod sursa (job #551851) | Cod sursa (job #1868469)
#include <unordered_set>
#include <iostream>
#include <fstream>
using namespace std;
ifstream in("dtcsu.in");
ofstream out("dtcsu.out");
const int numnr = 276997;
unordered_set <long long> gasit;
int main()
{
for(int i = 1; i <= numnr; i++)
{
long long x;
in >> x;
if(x % 2 == 1)
gasit.insert(x);
}
int q;
in >> q;
int nr = 0;
for(int i = 1; i <= q; i++)
{
long long x;
in >> x;
while(x > 0 && x % 2 == 0)
x = x >> 2;
if(gasit.find(x) == gasit.end())
nr++;
}
out << nr << "\n";
return 0;
}