Cod sursa(job #2315371)
| Utilizator | Data | 9 ianuarie 2019 21:21:52 | |
|---|---|---|---|
| Problema | Dtcsu | Scor | 20 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.57 kb |
#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;
}
