fork(1) download
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. #include <numeric>
  5. using namespace std;
  6.  
  7. bool sort_cmp( int a, int b )
  8. {
  9. return rand() < (RAND_MAX/2);
  10. }
  11. int main()
  12. {
  13. vector<int> tv;
  14. int N = 1000000;
  15. for (int i = 1; i<=N; i++) tv.push_back(i);
  16.  
  17. sort( tv.begin(), tv.end(), sort_cmp);
  18. for (int i = 1; i<=10; i++) cout << " " << tv[i];
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0.28s 16056KB
stdin
Standard input is empty
stdout
  426702  625104  276225  430691  922301  919172  797482  908274  599483  129040