Pagini recente » Cod sursa (job #1458511) | Cod sursa (job #3309886) | Cod sursa (job #77432) | Cod sursa (job #2022556) | Cod sursa (job #3327380)
#include <bits/stdc++.h>
#define P 8887
using namespace std;
ifstream fin("dtcsu.in");
ofstream fout("dtcsu.out");
vector <long long> h[P];
int q;
int main()
{
int i, cnt, gasit;
long long x;
for(i = 1; i <= 276997; i++)
{
fin >> x;
x /= (x & -x);
h[x % P].push_back(x);
}
cnt = 0;
fin >> q;
for(i = 1; i <= q; i++)
{
fin >> x;
if(x > 0)
{
x /= (x & -x);
gasit = 0;
for(long long y : h[x % P])
if(y == x) gasit = 1;
cnt += gasit;
}
}
fout << cnt << '\n';
return 0;
}