https://www.acmicpc.net/problem/1764 입출력 풀이 #include#include#include#include#includeusing namespace std;int main(){ ios_base::sync_with_stdio(0); cin.tie(nullptr); cout.tie(nullptr); int n, m; cin >> n >> m; string noListen; string noSee; map names; for (int i = 0; i > noListen; names[noListen] = true; } vector results; for (int i = 0; i > noSee; ..
입출력 풀이 #include #include #include #include using namespace std;bool compare(pair a, pair b){ return a.first > cnt; int age; string name; vector> info; for (int i = 0; i > age >> name; info.push_back({ age, name }); } stable_sort(info.begin(), info.end(), compare); cout stable_sort() 는 안정된 정렬을 보장한다따라서 비교하는 값이 같은 경우에는 입력된 순서대로 출력한다
입출력 풀이 #include #include #include #include using namespace std;int main(){ ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int cnt; cin >> cnt; string word; int key; vector> words; for (int i = 0; i > word; key = word.length(); words.push_back(make_pair(key, word)); } sort(words.begin(), words.end()); words.erase(uniq..