pastebin

Paste Search Dynamic
Recent pastes
arr
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <vector>
  4. using namespace std;
  5.  
  6. int main() {
  7.         int n;
  8.         cin>>n;
  9.         vector <pair <int,pair<int,int>>> arr(n);
  10.         for (int i=0; i<n; i++){
  11.                 cin>>arr[i].first;
  12.                 cin>>arr[i].second.first;
  13.                 arr[i].second.second=i+1;
  14.         }
  15.         sort(arr.begin(), arr.end());
  16.         for (int i=0; i<n; i++){
  17.                 cout<<arr[i].first<<" "<<arr[i].second.first<<" "<<arr[i].second.second<<endl;
  18.         }
  19.  
  20.         return 0;
  21. }
  22.  
Parsed in 0.003 seconds
comments powered by disqus