Pagini recente » Cod sursa (job #854828) | Cod sursa (job #1249844) | Cod sursa (job #2284429) | Istoria paginii runda/boji_round8 | Cod sursa (job #1566049)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("dtcsu.in");
ofstream fout("dtcsu.out");
const int NMax = 276997;
const int Size = 20;
const int BMax = 1e5;
const int v[] = {2, 3, 5, 7, 11};
char S[Size];
int pos = BMax - 1;
char Buffer[BMax];
inline void Read(long long int &x){
while(!isdigit(Buffer[pos])){
if(++pos == BMax){
fin.read(Buffer, BMax);
pos = 0;
}
}
x = 0;
while(isdigit(Buffer[pos])){
x = x * 10 + (Buffer[pos] - '0');
if(++pos == BMax){
fin.read(Buffer, BMax);
pos = 0;
}
}
}
int main(){
long long int q, ans, x;
for(int i = 1; i <= NMax; i++) fin >> S;
Read(q);
ans = 0;
while(q--){
Read(x);
for(int i = 0; i < 5; i++){
while(x % v[i] == 0) x /= v[i];
}
if(x == 1) ans++;
}
fout << ans;
return 0;
}