Cod sursa(job #1268048)
| Utilizator | Data | 20 noiembrie 2014 16:26:59 | |
|---|---|---|---|
| Problema | Dtcsu | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.52 kb |
#include <fstream>
#include <unordered_map>
using namespace std;
#define NMax 276997
ifstream f("dtcsu.in");
ofstream g("dtcsu.out");
unordered_map<int, long long> M;
int q,nr;
int main()
{
long long x;
int i;
for(i=1;i<=NMax;++i)
{
f>>x;
if(x%2) M[x] = i;
}
f>>q;
while(q--)
{
f>>x;
if (x & (-x)) x /= x & (-x);
if(x && M.find(x)!=M.end()) ++nr;
}
g<<nr<<"\n";
f.close();
g.close();
return 0;
}
