728x90
문제
link: https://www.acmicpc.net/problem/17219
사이트 주소에 맞는 비밀번호를 출력하는 문제이다.
접근
사이트 주소와 비밀번호를 딕셔너리에 저장하여 문제를 해결했다.
코드
import sys
input = sys.stdin.readline
N, M = map(int, input().split())
d = dict()
for _ in range(N):
url, pw = input().strip().split()
d[url] = pw
for _ in range(M):
print(d[input().strip()])
728x90
'코딩테스트' 카테고리의 다른 글
[백준] 2579 | 계단 오르기 [파이썬/python] (0) | 2025.04.03 |
---|---|
[백준] 1003 | 피보나치 함수 [파이썬/python] (0) | 2025.04.02 |
[백준] 11399 | ATM [파이썬/python] (0) | 2025.04.02 |
[백준] 1874 | 스택 수열 [파이썬/python] (0) | 2025.04.02 |
[백준] 1966 | 프린터 큐 [파이썬/python] (0) | 2025.04.02 |