难度指数:⭐⭐
知识点:
Mine:
代码实现
from collections import defaultdict
from time import time
def solve():
return 0
def solve0(i):
res = []
if i in dic.keys():
res += dic[i]
for j in dic[i]:
res += solve0(j)
return res
T = 1
while T:
n = int(input())
dic = defaultdict(lambda: [])
for i in range(n):
v, k = input().split(' ')
dic[k].append(v)
q = input()
t1 = time()
res = solve()
t2 = time()
res0 = 0
res = solve0(q)
for i in res:
print(i)
t3 = time()
print(res, res0)
print(t3 - t2, t2 - t1)
T -= 1