17219번: 비밀번호 찾기

myeongrangcoding·2024년 1월 8일
0

백준

목록 보기
45/47

https://www.acmicpc.net/problem/17219

풀이

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <unordered_map>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //freopen("input.txt", "rt", stdin);

    unordered_map<string, string> uMap;
    int N{}, M{};
    cin >> N >> M;

    string address, password;
    for (int i = 0; i < N; ++i)
    {
        cin >> address >> password;
        uMap[address] = password;
    }

    for (int i = 0; i < M; ++i)
    {
        cin >> address;
        cout << uMap[address] << '\n';
    }

    return 0;
}
profile
명랑코딩!

0개의 댓글