Pagini recente » Cod sursa (job #1834442) | Cod sursa (job #870096) | Cod sursa (job #2475123) | template/autor-necunoscut | Cod sursa (job #1917701)
#include<bits/stdc++.h>
using namespace std;
ifstream fin("dtcsu.in");
ofstream fout("dtcsu.out");
multiset<long long> hash;
int main()
{
for(int i=1;i<=276997;i++)
{
long long x;
fin>>x;
if((x&1)) hash.insert(x);
}
int q;
int sol=0;
fin>>q;
for(int i=1;i<=q;i++)
{
long long x;
fin>>x;
while(x && !(x&1)) x>>=1LL;
if(*hash.find(x)==x) sol++;
}
fout<<sol;
return 0;
}