We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0e1f2f7 commit 14ca1d5Copy full SHA for 14ca1d5
10813.py
@@ -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