ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1100. Final Standings

Um... Okay
Posted by Fast Bastards 7 Dec 2017 12:00
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
int main()
{
    int n;
    cin >> n;
    vector<pair<int, int> > v;
    int x, p;
    for(int i = 1; i <= n; i ++)
    {
        cin >> x >> p;
        v.pb({p, x});
    }
    sort(v.begin(), v.end());
    reverse(v.begin(), v.end());
    for(int i = 0; i < n; i ++)
    {
        cout << v[i].second << " " << v[i].first << "\n";
    }
}
But it is same sort