Pagini recente » Cod sursa (job #68583) | Cod sursa (job #1340706) | Cod sursa (job #1805195) | Cod sursa (job #1585018) | Cod sursa (job #1935930)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("dtcsu.in");
ofstream fout("dtcsu.out");
typedef long long int ll;
const int NMax = 276997;
const int BMax = 5e4 + 5;
int pos = BMax - 1;
char Buffer[BMax];
inline void Read(ll &x) {
while(!isdigit(Buffer[pos])) {
if(++pos == BMax) {
pos = 0;
fin.read(Buffer, sizeof(Buffer));
}
}
x = 0;
while(isdigit(Buffer[pos])) {
x = x * 10 + (Buffer[pos] - '0');
if(++pos == BMax) {
pos = 0;
fin.read(Buffer, sizeof(Buffer));
}
}
}
int main(){
ios::sync_with_stdio(false);
unordered_set < ll > uSet;
for(int i = 1; i <= NMax; i++) {
ll x;
Read(x);
while(x && !(x & 1)) x >>= 1;
uSet.insert(x);
}
ll n;
Read(n);
int ans = 0;
while(n--) {
ll x;
Read(x);
while(x && !(x & 1)) x >>= 1;
if(uSet.find(x) != uSet.end()) ans++;
}
fout << ans;
return 0;
}