Pagini recente » Cod sursa (job #447188) | Cod sursa (job #1827559) | Cod sursa (job #481793) | Cod sursa (job #546330) | Cod sursa (job #1856515)
#include <fstream>
#include <cstdio>
#include <vector>
#define MOD 30102
using namespace std;
int Q, i, ans;
long long x;
vector<long long> h[12290];
vector<long long> :: iterator it;
int main()
{
freopen("dtcsu.in", "r", stdin);
freopen("dtcsu.out", "w", stdout);
for (i=1; i<=276997; i++)
{
scanf("%lld", &x);
if (x % 2==1)
h[x % MOD].push_back(x);
}
scanf("%d", &Q);
for (i=1; i<=Q; i++)
{
scanf("%lld", &x);
if (!x)
continue;
x=x / (x & (-x));
for (it=h[x % MOD].begin(); it!=h[x % MOD].end(); it++)
{
if (*it==x)
{
ans++;
break;
}
}
}
printf("%d", ans);
return 0;
}