쏘ing

[Python] 백준 17219 비밀번호 찾기 본문

알고리즘/CLASS 3

[Python] 백준 17219 비밀번호 찾기

한민민 2022. 2. 21. 15:02

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

풀이

import sys

# N : 저장된 사이트 수, M : 찾고 싶은 사이트 수
N, M = map(int, sys.stdin.readline().rstrip().split())

# 딕셔너리
site = {}

for _ in range (N):
    a, b = sys.stdin.readline().rstrip().split()
    site[a] = b
    
for _ in range (M):
    print(site[sys.stdin.readline().rstrip()])

 

Comments