Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4.  
  5. ifstream in("5div.in");
  6. ofstream out("5div.out");
  7.  
  8. bool v[4][2000000];
  9. int n;
  10.  
  11. int main()
  12. {
  13.  
  14. in>>n;
  15.  
  16. for(int i=2;i<=n;i++){
  17. for(int j=i;j<=n;j=j+i){
  18. j--;
  19. if(v[0][j]==1)
  20. if(v[1][j]==1)
  21. if(v[2][j]==1)
  22. if(v[3][j]==1);
  23. else v[3][j]=1;
  24. else v[2][j]=1;
  25. else v[1][j]=1;
  26. else v[0][j]=1;
  27. j++;
  28. }
  29. }
  30.  
  31.  
  32. for(int i=0;i<=n;i++){
  33. if(v[3][i]==1) out<<i+1<<' ';
  34. }
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement