백준 1547번: 공 #Python

ColorlessDia·2025년 3월 7일

algorithm/baekjoon

목록 보기
474/807
M = int(input())

cup_list = [1, 2, 3]

for _ in range(M):
    X, Y = map(lambda x: int(x) - 1, input().split())

    cup_list[Y], cup_list[X] = cup_list[X], cup_list[Y]

print(cup_list.index(1) + 1)

0개의 댓글