Pagini recente » Cod sursa (job #662929) | Cod sursa (job #2419647) | Cod sursa (job #2115631) | Cod sursa (job #1284726) | Cod sursa (job #1828586)
#include<bits/stdc++.h>
using namespace std;
ifstream fin("dtcsu.in");
ofstream fout("dtcsu.out");
const int BMax=1<<10;
int pos=1023;
char Buffer[BMax];
inline void read(long long &x){
while(!isdigit(Buffer[pos]))
if(++pos == BMax)
{
fin.read(Buffer, BMax);
pos = 0;
}
x=0LL;
while(isdigit(Buffer[pos]))
{
x=x*10LL+(Buffer[pos]-'0');
if(++pos==BMax)
{
fin.read(Buffer, BMax);
pos = 0;
}
}
}
unordered_set<long long> s;
const int N = 276997;
long long x, q, ans;
int main() {
for(int i=1; i<=N; ++i) {
read(x);
if((x&1)) s.insert(x);
}
read(q);
for(int i=1; i<=q; ++i) {
read(x);
if(x) x/= x & (-x);
if(x & s.find(x) != s.end())
++ans;
}
fout << ans << '\n';
return 0;
}