Pagini recente » Cod sursa (job #150990) | Cod sursa (job #2221335) | Cod sursa (job #1326340) | Cod sursa (job #2058275) | Cod sursa (job #3256316)
#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;
x = x / (x & -x);
rasp += cautare(x);
}
fcout << rasp;
return 0;
}