anon20016

H

Nov 14th, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #define _CRT_SECURE_NO_DEPRECATE
  2.  
  3. #include <iostream>
  4. #include <vector>
  5. #include <string>
  6. #include <map>
  7. #include <set>
  8. #include <algorithm>
  9.  
  10. using namespace std;
  11.  
  12. long long binpow(long long a, int n, long long p) {
  13. long long res = 1;
  14. while (n > 0) {
  15. if (n & 1)
  16. res = (res * a) % p;
  17. a = (a * a) % p;
  18. n >>= 1;
  19. }
  20. return res;
  21. }
  22.  
  23. int main() {
  24. freopen("input.txt", "r", stdin);
  25. freopen("output.txt", "w", stdout);
  26. int n;
  27. cin >> n;
  28. vector<pair<int, pair<int, int> > > a(n);
  29. for (int i = 0; i < n; i++) {
  30. cin >> a[i].first >> a[i].second.second;
  31. a[i].second.first = i;
  32. }
  33. sort(a.begin(), a.end());
  34. for (int i = 0; i < n; i++) {
  35. cout << a[i].first << ' ' << a[i].second.second << endl;
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment