728x90
반응형
단순 구현
#include <iostream>
#include <unordered_map>
#include <string>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int N, M;
cin >> N >> M;
unordered_map<string, string> sites;
while (N--)
{
string site, password;
cin >> site >> password;
sites[site] = password;
}
while (M--)
{
string find_site;
cin >> find_site;
if (sites.find(find_site) != sites.end())
{
cout << sites[find_site] << '\n';
}
}
return 0;
}
728x90
반응형
'Baekjoon > Silver' 카테고리의 다른 글
Baekjoon 10816.숫자 카드 2 c++ [Silver IV] (0) | 2024.12.30 |
---|---|
Baekjoon 1436.영화감독 슘 c++ [Silver V] (0) | 2024.12.28 |
Baekjoon 11399.ATM c++[Silver IV] (0) | 2024.12.22 |
Baekjoon 1764.듣보잡 c++[Silver IV] (1) | 2024.12.18 |
Baekjoon 11723.집합 c++ [Silver V] (2) | 2024.12.13 |