Cod sursa(job #1502782)
| Utilizator | Data | 14 octombrie 2015 23:54:26 | |
|---|---|---|---|
| Problema | Dtcsu | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.56 kb |
#include <fstream>
#include <map>
using namespace std;
ifstream fin("dtcsu.in");
ofstream fout("dtcsu.out");
int Q, lg, sol;
long long N;
map<long long, bool> H;
int main()
{
long long x;
for (int i = 1; i <= 276997; ++i)
{
fin >> x;
if (x & 1)
H[x] = true;
}
fin >> Q;
while (Q--)
{
fin >> N;
if (N & -N)
N /= (N & -N);
if (H[N])
++sol;
}
fout << sol << '\n';
fin.close();
fout.close();
return 0;
}
