|
|
back to boardUm... Okay #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 |
|
|