Advertisement
jeff69

Untitled

Mar 3rd, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. #include <iomanip>
  2. #include <iostream>
  3. #include <functional>
  4. #include <algorithm>
  5. #include <math.h>
  6. #include <cmath>
  7. #include <string>
  8. #include <vector>
  9. #include<utility>
  10. using namespace std;
  11. #define mp make_pair;
  12. int a[200000]; int n, k;
  13. vector < pair <int, int>>bianca(k);
  14. bool cmp(pair<int, int>a, pair<int, int>b){//alexlo8i
  15. if (a.first > b.first&&a.second > b.second)return a > b;
  16. else return b > a;
  17. }
  18. int main()
  19. {
  20.  
  21. cin >> k;
  22. for (int i = 0; i < k; i++){
  23. int g;
  24. cin >> g;
  25. bianca.push_back(std::make_pair(g, i));
  26. }
  27. sort(bianca.begin(),bianca.end(),cmp);//alexlo8i
  28.  
  29. for (int i = k - 1; i > 0; i--){
  30. if (bianca[i].first == bianca[i - 1].first){
  31. bianca.erase(bianca.begin() + (i - 1));
  32.  
  33. }
  34. }
  35. for (int i = 0; i < bianca.size(); i++){
  36.  
  37. cout << bianca[i].second << " ";
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement