728x90
반응형
https://www.acmicpc.net/problem/17219
📌 풀이
한 줄씩 공백으로 split()해서 받고, 딕셔너리 타입으로 저장해 둔다.
N+2줄부터는 key 값으로 value 찾기니까 쉽다!
N, M = map(int, input().split())
pwd = {}
for _ in range(N):
site, pw = map(str, input().split())
pwd[site] = pw
for _ in range(M):
toFind = input()
print(pwd[toFind])
728x90
반응형
'코딩테스트 > BAEKJOON' 카테고리의 다른 글
[백준/Python] 1463. 1로 만들기 (0) | 2024.11.18 |
---|---|
[백준/Python] 1003. 피보나치 함수 (0) | 2024.11.18 |
[백준/Python] 11047. 동전 0 (0) | 2024.11.18 |
[백준/Python] 11399. ATM (0) | 2024.11.18 |
[백준/Python] 1764. 듣보잡 (0) | 2024.11.18 |