Pagini recente » Cod sursa (job #34805) | Monitorul de evaluare | Cod sursa (job #550472) | Cod sursa (job #2860795) | 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;
}