Pagini recente » Cod sursa (job #2427435) | Cod sursa (job #2472643) | Cod sursa (job #383776) | Cod sursa (job #215239) | Cod sursa (job #3256317)
#include <bits/stdc++.h>
using namespace std;
ifstream fcin("dtcsu.in");
ofstream fcout("dtcsu.out");
const int P = 8887;
std::vector<long long> h[P];
int n, m, rasp;
int cautare(long long x)
{
int r = x % P;
for (long long e : h[r])
if (e == x)
return 1;
return 0;
}
int main()
{
long long x;
for (int i = 1; i <= 276997; i++)
{
fcin >> x;
x = x / (x & -x);
h[x % P].push_back(x);
}
int q;
fcin >> q;
while (q--)
{
fcin >> x;
if (x > 0)
{
x = x / (x & -x);
rasp += cautare(x);
}
}
fcout << rasp;
return 0;
}