Pagini recente » Cod sursa (job #1189001) | Cod sursa (job #1001397) | Cod sursa (job #1938491) | Cod sursa (job #988628) | Cod sursa (job #1495347)
#include <cstdio>
#include <ctype.h>
#include <unordered_set>
using namespace std;
unordered_set <long long> mySet;
int nr;
long long X, Q;
inline long long citeste(){
long long x=0;
char ch = fgetc(fin);
while(!isdigit(ch)){
ch = fgetc(fin);
}
while(isdigit(ch)){
x = 10*x+ch-'0';
ch = fgetc(fin);
}
return x;
}
int main(){
freopen("dtcsu.in" ,"r", stdin );
freopen("dtcsu.out","w", stdout);
for(int i = 1; i <= 276997; i ++){
//scanf("%lld", &X);
X = citeste();
if((X&1))
mySet.insert(X);
}
//scanf("%d", &Q);
Q = citeste();
for(int i = 1; i <= Q; i ++){
//scanf("%lld", &X);
X = citeste();
if(!(X&1) && (X&(-X)))
X /= (X&(-X));
if(mySet.count(X))
nr ++;
}
printf("%lld\n", nr);
fclose(stdin );
fclose(stdout);
return 0;
}