백준 28446번: 볼링공 찾아주기 #Python

ColorlessDia·2024년 8월 11일

algorithm/baekjoon

목록 보기
266/836
import sys

M = int(sys.stdin.readline())

locker = dict()

for _ in range(M):
    line = list(map(int, sys.stdin.readline().rstrip().split()))

    request = line[0]
    weight = line[-1]

    if request == 1:
        x = line[1]
        locker[weight] = x
        continue
    
    print(locker[weight])

0개의 댓글