Pagini recente » Cod sursa (job #1361919) | Istoria paginii runda/runda_ezoterica_3 | Cod sursa (job #1117009) | Cod sursa (job #1515675) | Cod sursa (job #3209315)
#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, Q, cnt = 0, gasit, r;
long long x;
ios_base::sync_with_stdio(0);
fin.tie(0);
fout.tie(0);
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;
}