Pagini recente » Cod sursa (job #1753718) | Cod sursa (job #1187896) | Cod sursa (job #62402) | Cod sursa (job #394375) | Cod sursa (job #1740077)
#include <cstdio>
#include <cctype>
#include <unordered_set>
using namespace std;
unordered_set <long long> s;
#define MAXBUF (1<<17)
char buf[MAXBUF];
int pos=MAXBUF;
FILE*fi,*fout;
inline char nextch(){
if(pos==MAXBUF){
fread(buf,1,MAXBUF,fi);
pos=0;
}
return buf[pos++];
}
inline long long getnr(){
char a=nextch();
while(isdigit(a)==0)
a=nextch();
long long nr=0;
while(isdigit(a)==1){
nr=nr*10+a-'0';
a=nextch();
}
return nr;
}
int main(){
int i,q,rez,a,n;
long long x;
fi=fopen("dtcsu.in" ,"r");
fout=fopen("dtcsu.out" ,"w");
for(i=1;i<=276997;i++){
x=getnr();
if(x&1)
s.insert(x);
}
q=getnr();
rez=0;
while(q>0){
q--;
x=getnr();
if(x>0)
x/=(x&(-x));
if(s.find(x)!=s.end())
rez++;
}
fprintf(fout,"%d" ,rez);
fclose(fi);
fclose(fout);
return 0;
}