Cod sursa(job #1268063)
| Utilizator | Data | 20 noiembrie 2014 16:32:45 | |
|---|---|---|---|
| Problema | Dtcsu | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.51 kb |
#include <fstream>
#include <unordered_set>
using namespace std;
#define NMax 276997
ifstream f("dtcsu.in");
ofstream g("dtcsu.out");
unordered_set<long long> M;
long long q,nr,x;
int main()
{
int i;
for(i=1;i<=NMax;++i)
{
f>>x;
if(x&1) M.insert(x);
}
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;
}
