-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestCode.py
More file actions
50 lines (33 loc) · 708 Bytes
/
testCode.py
File metadata and controls
50 lines (33 loc) · 708 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# 문제 정보
# 5 4
# 1 3
# 1 2
# 2 3
# 2 4
# 4
# 4
# 3
# 4
# 1
# === import module ===#
# === variable declare ===#
n = 0;
k = 0;
switchs = [];
stdArray = [];
stdSwitch = [];
# === Function define ===#
# === main function ===#
n,k = map(int, input().split())
stdArray = [0 for _ in range(n)]
stdSwitch = [i for i in range(n)]
for i in range(k):
switchs.append(list(map(int, input().split())));
for i in range(k):
for item in switchs:
sit1, sit2 = item[0], item[1];
stdSwitch[stdArray[sit1]] += 1;
stdSwitch[stdArray[sit2]] += 1;
stdArray[]
stdArray[item[1]], stdArray[[item[0]]] = stdArray[[item[0]]], stdArray[[item[1]]]
print(stdSwitch);