CodeForces 576A - Vasya and Petya's Game

#include #include #include using namespace std; int main() { int n; cin>>n; bool flag[1005]; memset(flag,0,sizeof(flag)); vector v1; for(int i=2; i<=n; ++i) { if(flag[i]==0) { for(int j=i*i; j<=n; j+=i) flag[j]=1; for(int j=i; j<=n; j*=i) v1.push_back(j); } } cout<


    推荐阅读