Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iomanip>
- #include <iostream>
- #include <functional>
- #include <algorithm>
- #include <math.h>
- #include <cmath>
- #include <string>
- #include <vector>
- #include<utility>
- using namespace std;
- #define mp make_pair;
- int a[200000]; int n, k;
- vector < pair <int, int>>bianca(k);
- bool cmp(pair<int, int>a, pair<int, int>b){//alexlo8i
- if (a.first > b.first&&a.second > b.second)return a > b;
- else return b > a;
- }
- int main()
- {
- cin >> k;
- for (int i = 0; i < k; i++){
- int g;
- cin >> g;
- bianca.push_back(std::make_pair(g, i));
- }
- sort(bianca.begin(),bianca.end(),cmp);//alexlo8i
- for (int i = k - 1; i > 0; i--){
- if (bianca[i].first == bianca[i - 1].first){
- bianca.erase(bianca.begin() + (i - 1));
- }
- }
- for (int i = 0; i < bianca.size(); i++){
- cout << bianca[i].second << " ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement