arr
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
int n;
cin>>n;
vector <pair <int,pair<int,int>>> arr(n);
for (int i=0; i<n; i++){
cin>>arr[i].first;
cin>>arr[i].second.first;
arr[i].second.second=i+1;
}
sort(arr.begin(), arr.end());
for (int i=0; i<n; i++){
cout<<arr[i].first<<" "<<arr[i].second.first<<" "<<arr[i].second.second<<endl;
}
return 0;
}
Parsed in 0.003 seconds