코드#include #include #include #include #include #include using namespace std;int cnt, n, k;unordered_map mp;string s;vector> v;vector res;void FASTIO() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);}bool cmp(pair a, pair b) { return a.second > k >> n; for(int i = 0; i > s; mp[s] = ++cnt; } for(const auto& e : mp) { v.push_back(make_pair(e.fir..
13414번
코드 # 파이썬 3.7부터 딕셔너리 순서는 삽입 순서임이 보장된다. # https://docs.python.org/ko/3/library/stdtypes.html#dict import sys input = sys.stdin.readline n,m = map(int, input().split()) table = dict() for _ in range(m): x = input().rstrip() if x in table: # 이미 있다면 딕셔너리에서 제거 table.pop(x) table[x] = 1 # 추가 print(*list(table.keys())[:n], sep="\n") 딕셔너리 삽입 순서가 보장되는 것이 어렴풋이 기억나 해결한 문제. https://blog.hwahae.co.kr/all/tech..