Mai intai trebuie sa te autentifici.
Cod sursa(job #1917747)
Utilizator | Data | 9 martie 2017 12:58:55 | |
---|---|---|---|
Problema | Dtcsu | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.47 kb |
#include<bits/stdc++.h>
using namespace std;
ifstream fin("dtcsu.in");
ofstream fout("dtcsu.out");
set<long long> h;
int main()
{
for(int i=1;i<=276997;i++)
{
long long x;
fin>>x;
if((x&1)) h.insert(x);
}
int q;
int sol=0;
fin>>q;
for(int i=1;i<=q;i++)
{
long long x;
fin>>x;
while(x && !(x&1)) x>>=1LL;
if(h.find(x)!=h.end()) sol++;
}
fout<<sol;
return 0;
}