[백준] 17219번 비밀번호 찾기 (C++, 해시)
728x90
반응형
#define _CRT_SECURE_NO_DEPRECATE
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <unordered_map>
using namespace std;
int main(void) {
ios::sync_with_stdio(false);
cin.tie(NULL);
int n, m;
cin >> n >> m;
unordered_map<string, string> hash;
string add, pass;
for (int i = 0; i < n; i++) {
cin >> add >> pass;
hash[add] = pass;
}
string tmp;
for (int i = 0; i < m; i++) {
cin >> tmp;
cout << hash[tmp] << "\n";
}
return 0;
}
728x90
반응형
'백준' 카테고리의 다른 글
[백준] 11652번 카드 (C++, 정렬) (0) | 2021.10.07 |
---|---|
[백준] 1431번 시리얼 번호 (C++, 정렬) (0) | 2021.10.07 |
[백준] 13414번 수강신청 (C++, 해시) (0) | 2021.10.06 |
[백준] 1620번 나는야 포켓몬 마스터 이다솜 (C++, 해시) (0) | 2021.10.06 |
[백준] 1012번 유기농 배추 (C++, BFS) (0) | 2021.10.06 |
TAGS.