Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. //#include <ext/pb_ds/detail/standard_policies.hpp>
  4. //#include <ext/pb_ds/assoc_container.hpp>
  5. //#include <ext/pb_ds/tree_policy.hpp>
  6.  
  7. //#pragma GCC optimize("Ofast")
  8. //#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
  9.  
  10. #define ll long long
  11. #define ld long double
  12. #define pb push_back
  13. #define F first
  14. #define S second
  15. #define endl '\n'
  16. #define int long long
  17.  
  18. using namespace std;
  19.  
  20. //using namespace __gnu_pbds;
  21. //template <typename T> using ordered_set = tree <T, null_type, less < T >, rb_tree_tag, tree_order_statistics_node_update>;
  22.  
  23. const int N = 1e6 + 100;
  24. const int M = 30;
  25. const ll mod = 1e9 + 7;
  26. const ll MOD = 998244353;
  27. const int P = 1336;
  28. const ld eps = 0.000000001;
  29. const int inf = 1e9 + 7;
  30.  
  31. mt19937 gen(chrono::high_resolution_clock::now().time_since_epoch().count());
  32.  
  33. int32_t main()
  34. {
  35. ios_base::sync_with_stdio(0);
  36. cin.tie(0);
  37. cout.tie(0);
  38. srand(time(0));
  39.  
  40. //freopen("input.txt", "r", stdin);
  41. //freopen("output.txt", "w", stdout);
  42.  
  43. int n;
  44. cin >> n;
  45.  
  46. vector < pair < pair <int, int>, pair <int, int> > > a;
  47. a.resize(n);
  48.  
  49. for(int i = 0; i < n; i++)
  50. {
  51. cin >> a[i].F.F >> a[i].F.S >> a[i].S.F;
  52. a[i].S.S = i;
  53. }
  54.  
  55. sort(a.begin(), a.end());
  56.  
  57. for(int i = 0; i < a.size(); i += 2)
  58. {
  59. cout << a[i].S.S + 1 << " " << a[i + 1].S.S + 1 << endl;
  60. }
  61.  
  62.  
  63.  
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement