Pagini recente » Cod sursa (job #2134899) | Cod sursa (job #1965883) | Cod sursa (job #467379) | Cod sursa (job #1135225)
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<set>
#define nmax 276997
using namespace std;
int n,i,j,k;
set<long long>s;
long long x;
char c[22];
int main()
{
freopen("dtcsu.in","r",stdin);
freopen("dtcsu.out","w",stdout);
for (i=1;i<=nmax;i++)
{
gets(c);
x=0;
char *p=c;
while (*p>='0' && *p<='9') x=x*10+*p-'0',++p;
if (x&1) s.insert(x);
}
scanf("%d\n",&n);
for (i=1;i<=n;i++)
{
gets(c);
x=0;
char *p=c;
while (*p>='0' && *p<='9') x=x*10+*p-'0',++p;
if (x!=0)
{
x/=(x&(-x));
if (s.find(x)!=s.end()) k++;
}
}
printf("%d\n",k);
return 0;
}