Advertisement
Guest User

Untitled

a guest
Jul 14th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <vector>
  4. #include <algorithm>
  5.  
  6. using namespace std;
  7.  
  8. ofstream out("input.txt");
  9.  
  10. int main()
  11. {
  12.     int max;
  13.     cin >> max;
  14.     out << max << " " << max << endl;
  15.    
  16.     vector<int> N(max);
  17.     for (int i=0; i<max; i++)
  18.     {
  19.         N[i] = i;
  20.         out << i << " ";
  21.     }
  22.     out << endl;
  23.     random_shuffle(N.begin(),N.end());
  24.     for (int i=0; i<max; i++)
  25.         out << N[i] << " ";
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement