Josif_tepe

Untitled

Jan 25th, 2026
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.    
  6.     int n;
  7.     cin >> n;
  8.    
  9.     vector<pair<int, pair<int, int>>> v;
  10.     for(int i = 1; i < n; i++) {
  11.         for(int j = i + 1; j <= n; j++) {
  12.             int x;
  13.             cin >> x;
  14.            
  15.             v.push_back({x, {i, j}});
  16.         }
  17.     }
  18.    
  19.     sort(v.begin(), v.end());
  20.     return 0;
  21. }
  22.  
  23.  
  24.  
  25.  
  26.  
Advertisement
Add Comment
Please, Sign In to add comment