Pagini recente » Cod sursa (job #459846) | Cod sursa (job #42275) | Cod sursa (job #2942132) | Cod sursa (job #1032205) | Cod sursa (job #3209320)
#include <bits/stdc++.h>
#define P 8887
using namespace std;
ifstream fin("dtcsu.in");
ofstream fout("dtcsu.out");
vector<long long> M[P];
int main()
{
int i, n, r, Q, cnt = 0, gasit;
long long x;
for (i = 1; i <= 276997; i++)
{
fin >> x;
x /= (x & (-x)); /// while (x%2==0) x/=2;
M[x % P].push_back(x);
}
fin >> Q;
while (Q--)
{
fin >> x;
if (x > 0)
{
x /= (x & (-x));
gasit = 0;
r = x % P;
for (long long e : M[r])
if (e == x) gasit = 1;
cnt += gasit;
}
}
fout << cnt << "\n";
return 0;
}