#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool cmp(pair<int,string>x ,pair<int,string>y) {
return (x.first < y.first);
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int N;
cin >> N;
vector<pair<int, string>> v(N);
for (int i = 0; i < N; i++) {
cin >> v[i].first >> v[i].second;
}
stable_sort(v.begin(), v.end(), cmp);
for (int i = 0; i < N; i++) {
cout << v[i].first << " " << v[i].second << "\n";
}
}
'Algorithm π§π»βπ» > λ°±μ€(BOJ)' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
[λ°±μ€,c++] 10817λ² - μΈ μ (0) | 2021.10.24 |
---|---|
[λ°±μ€,c++] 10816λ² - μ«μμΉ΄λ 2 (0) | 2021.10.24 |
[λ°±μ€,c++] 10815λ² - μ«μμΉ΄λ (0) | 2021.10.24 |
[λ°±μ€,c++] 10811λ² - λ°κ΅¬λ λ€μ§κΈ° (0) | 2021.10.24 |
[λ°±μ€,c++] 10809λ² - μνλ²³ μ°ΎκΈ° (0) | 2021.10.23 |
[λ°±μ€,c++] 10808λ² - μνλ²³ κ°μ (0) | 2021.10.23 |
λκΈ