728x90
반응형
https://www.acmicpc.net/problem/11651
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
vector<pair<int, int>> v;
int n, x, y;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> x >> y;
v.push_back({ y, x });
}
sort(v.begin(), v.end());
for (int i = 0; i < n; i++) {
cout << v[i].second << " " << v[i].first << '\n';
}
return 0;
}
728x90
반응형
'Algorithm > BAEKJOON' 카테고리의 다른 글
[BOJ] 1927번 최소 힙 (C++) (0) | 2021.11.10 |
---|---|
[BOJ] 15649번 N과 M (1) (C++) (0) | 2021.11.09 |
[BOJ] 11650번 좌표 정렬하기 (C++) (0) | 2021.11.07 |
[BOJ] 2178번 미로 탐색 (C++) (0) | 2021.11.07 |
[BOJ] 11279번 최대 힙 (C++) (0) | 2021.11.07 |