Skip to content

Commit d1301ac

Browse files
author
hangyeol
committed
113차 2번 문제풀이
1 parent 2cae78a commit d1301ac

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import sys
2+
from collections import defaultdict
3+
4+
5+
def main():
6+
input = sys.stdin.readline
7+
N = int(input())
8+
9+
graph = defaultdict(list)
10+
11+
for _ in range(N):
12+
food = list(map(str, input().strip().split()))
13+
K = int(food[0])
14+
foods = food[1:]
15+
16+
current_node = graph
17+
18+
for f in foods:
19+
if f not in current_node:
20+
current_node[f] = defaultdict(list)
21+
current_node = current_node[f]
22+
23+
24+
if __name__ == '__main__':
25+
main()

0 commit comments

Comments
 (0)