Pagini recente » Cod sursa (job #980294) | Cod sursa (job #1678886) | Cod sursa (job #540348) | Cod sursa (job #3220093) | Cod sursa (job #3209293)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("dtcsu.in");
ofstream fout("dtcsu.out");
unordered_map<long long, bool> M;
int main()
{
int i, n, Q, cnt = 0;
long long x;
for (i = 1; i <= 276997; i++)
{
fin >> x;
x /= (x & (-x)); /// while (x%2==0) x/=2;
M[x] = true;
}
fin >> Q;
while (Q--)
{
fin >> x;
x /= (x & (-x));
if (M[x] == true) cnt++;
}
fout << cnt << "\n";
return 0;
}