Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.99 KB | None | 0 0
  1. //#pragma GCC optimize("Ofast")
  2. //#pragma GCC optimize("fast-math")
  3. //#pragma GCC optimize("unroll-loops")
  4. #include <iostream>
  5. #include <cstdio>
  6. #include <fstream>
  7. #include <cmath>
  8. #include <vector>
  9. #include <algorithm>
  10. #include <string>
  11. #include <climits>
  12. #include <map>
  13. #include <set>
  14. #include <deque>
  15. #include <tuple>
  16. using namespace std;
  17. #define sz(x) int(x.size())
  18. #define beg(x) x.begin(), x.end()
  19. #define pow2(x) ((x)*(x))
  20. #define get_auto(x) for (auto& var : x) {cout<<var<<' ';}
  21. typedef long long ll;
  22. typedef unsigned long long ull;
  23. typedef long double ld;
  24. typedef vector < ll > vll;
  25. typedef vector < int > vi;
  26. typedef vector < pair<int, int> > vii;
  27.  
  28. bool cmp(const int &a,const int &b){
  29.     return a>b;
  30. }
  31.  
  32. int main() {
  33.     vi v;
  34.     int x;
  35.     while(cin>>x){
  36.         v.push_back(x);
  37.     }
  38.     vi v_copy = v;
  39.     sort(beg(v_copy),cmp);
  40.     get_auto(v_copy);
  41.     cout<<endl;
  42.     for (auto it = v.rbegin(); it != v.rend() ; ++it) {
  43.         cout<<*it<<' ';
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement