Pagini recente » Cod sursa (job #1033103) | Cod sursa (job #1020494) | Cod sursa (job #930272) | Cod sursa (job #114811) | Cod sursa (job #2315371)
#include <fstream>
#include <set>
using namespace std;
ifstream fin("dtcsu.in");
ofstream fout("dtcsu.out");
int Q, sol;
set <long long> S;
int main()
{
long long x;
for(int i = 1; i <= 276997; i++)
{
fin >> x;
if(x & 1)
S.insert(x);
}
fin >> Q;
for(int i = 1; i <= Q; i++)
{
fin >> x;
if(x < 0)
continue ;
long long lastBit = x & (-x);
if(S.find(x / lastBit) != S.end())
sol++;
}
fout << sol;
return 0;
}