long max=20*n;
for (long l = 2; l <= 200000; l++) {
vct.push_back(l);
}
return vct;
}
vector
vector
for (int i = 0; i < elementsVector.size(); i++) {
p = find(vct.begin(), vct.end(), elementsVector[i]);
if (p < vct.end() || ((p == vct.end()) &&(vct.back() == elementsVector[i]))) {
vct.erase(p);
}
}
return vct;
}
void eulerSieve(long n) {
vector
vector
range = fillVector(long n);
while (range.size() > 0) {
long front = range.front();
vector
cout<<" Front = "<
for (int i = 0; i < range.size(); i++) {
long temp = front * range[i];
if (temp > range.back()) {
break;
}
toBeRemoved.push_back(temp);
}
range = removeElement(range, toBeRemoved);
range = removeElement(range, vector
}
cout << "Prime :" << prime.at(n) << endl;
}
1 comment:
it does not compile
Post a Comment