Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ifstream in("5div.in");
- ofstream out("5div.out");
- bool v[4][2000000];
- int n;
- int main()
- {
- in>>n;
- for(int i=2;i<=n;i++){
- for(int j=i;j<=n;j=j+i){
- j--;
- if(v[0][j]==1)
- if(v[1][j]==1)
- if(v[2][j]==1)
- if(v[3][j]==1);
- else v[3][j]=1;
- else v[2][j]=1;
- else v[1][j]=1;
- else v[0][j]=1;
- j++;
- }
- }
- for(int i=0;i<=n;i++){
- if(v[3][i]==1) out<<i+1<<' ';
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement