Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_DEPRECATE
- #include <iostream>
- #include <vector>
- #include <string>
- #include <map>
- #include <set>
- #include <algorithm>
- using namespace std;
- long long binpow(long long a, int n, long long p) {
- long long res = 1;
- while (n > 0) {
- if (n & 1)
- res = (res * a) % p;
- a = (a * a) % p;
- n >>= 1;
- }
- return res;
- }
- int main() {
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- int n;
- cin >> n;
- vector<pair<int, pair<int, int> > > a(n);
- for (int i = 0; i < n; i++) {
- cin >> a[i].first >> a[i].second.second;
- a[i].second.first = i;
- }
- sort(a.begin(), a.end());
- for (int i = 0; i < n; i++) {
- cout << a[i].first << ' ' << a[i].second.second << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment