We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0166c1e commit 2c23dedCopy full SHA for 2c23ded
1 file changed
live11/test117/문제2/박희경.py
@@ -0,0 +1,21 @@
1
+import sys
2
+from collections import *
3
+
4
+input = sys.stdin.readline
5
6
+graph = defaultdict(list)
7
+n = int(input())
8
+for _ in range(n-1):
9
+ u, v = map(int, input().split())
10
+ graph[u].append(v)
11
12
13
+# def parent(x):
14
+# x_root = set()
15
+# while x in graph[x]:
16
+# x_root.add(x)
17
+# x = graph[x]
18
19
20
21
+# parent(2)
0 commit comments