Skip to content

Commit 14ca1d5

Browse files
committed
[#5] Feat: Add 공 바꾸기
1 parent 0e1f2f7 commit 14ca1d5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

10813.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# 공 바꾸기
2+
3+
N, M = map(int, input().split(' '))
4+
baskets = [str(i+1) for i in range(N)]
5+
6+
for _ in range(M):
7+
i, j = map(int, input().split(' '))
8+
baskets[i-1], baskets[j-1] = baskets[j-1], baskets[i-1]
9+
10+
print(' '.join(baskets))

0 commit comments

Comments
 (0)