쏘ing
[Python] 백준 1620 나는야 포켓몬 마스터 이다솜 본문
https://www.acmicpc.net/problem/1620


풀이
import sys
N, M = map(int, sys.stdin.readline().rstrip().split())
poke = {}
# 딕셔너리
# 번호 : 포켓몬 이름
# 포켓몬 이름 : 번호
for i in range(1, N+1):
temp = sys.stdin.readline().rstrip()
poke[str(i)] = temp
poke[temp] = str(i)
for i in range(1, M+1):
print(poke[sys.stdin.readline().rstrip()])
'알고리즘 > CLASS 3' 카테고리의 다른 글
[Python] 백준 1764 듣보잡 (0) | 2022.02.21 |
---|---|
[Python] 백준 17219 비밀번호 찾기 (0) | 2022.02.21 |
[Python] 백준 1676 팩토리얼 0의 개수 (0) | 2022.02.21 |
[Python] 백준 9375 패션왕 신해빈 (0) | 2022.02.21 |
[Python] 백준 11723 집합 (0) | 2022.02.08 |
Comments