Pagini recente » Cod sursa (job #1039699) | Cod sursa (job #356816) | Cod sursa (job #3167265) | Cod sursa (job #989348) | Cod sursa (job #2315375)
#include <fstream>
#include <unordered_set>
using namespace std;
ifstream fin("dtcsu.in");
ofstream fout("dtcsu.out");
int Q, sol;
unordered_set <long long> S;
int main()
{
unsigned 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;
}