Pagini recente » Cod sursa (job #1862495) | Cod sursa (job #1450076) | Cod sursa (job #2881943) | Cod sursa (job #1138838) | Cod sursa (job #2206974)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("dtcsu.in");
ofstream fout("dtcsu.out");
const int NMAX = 276997;
unordered_set <long long> v;
long long read() {
string s;
getline(fin, s);
long long x = 0;
for(string :: iterator it = s.begin(); it < s.end(); it++)
x = x * 10 + (*it - '0');
return x;
}
int main()
{
int nr = 0;
long long x, k;
for(int i = 0; i < NMAX; i++) {
x = read();
v.insert(x / (x & (-x)));
}
k = read();
while(k--) {
x = read();
if(x && v.find(x / (x & (-x))) != v.end()) nr++;
}
fout << nr;
fin.close();
fout.close();
return 0;
}