Skip to content

Commit 73d0f74

Browse files
committed
[BOJ] #1547.공 / 브론즈3 / 10(O)
1 parent 26e3054 commit 73d0f74

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
M = int(input())
2+
3+
cups = [1, 2, 3]
4+
5+
def change_cups(X, Y):
6+
x = cups.index(X)
7+
y = cups.index(Y)
8+
9+
# cups 리스트에서 X번째와 Y번째 요소 교환
10+
cups[x], cups[y] = cups[y], cups[x]
11+
12+
for _ in range(M):
13+
X, Y = map(int, input().split())
14+
change_cups(X, Y)
15+
16+
print(cups[0])

0 commit comments

Comments
 (0)