Cod sursa(job #1065608)
| Utilizator | Data | 23 decembrie 2013 15:10:28 | |
|---|---|---|---|
| Problema | Dtcsu | Scor | 20 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.52 kb |
#include<algorithm>
#include<unordered_set>
using namespace std;
unordered_set<long long> S;
int main()
{
freopen("dtcsu.in","r",stdin);
freopen("dtcsu.out","w",stdout);
int N=0,Q;long long x;
for(int i=1;i<=276997;i++)
{
scanf("%lld",&x);
if(x&1)
S.insert(x);
}
scanf("%d",&Q);
for(int i=1;i<=Q;i++)
{
scanf("%lld",&x);
while(x%2==0) x>>=1;
if(S.count(x))
N++;
}
printf("%d\n",N);
return 0;
}
