n,m = input().split(" ") n,m = int(n),int(m) dl = [input().split(" ") for i in range(m)] node_root = {} for d in dl: if d[0] in node_root: node_root[d[0]].append(d[1]) else: node_root[d[0]] = [d[1]] if d[1] in node_root: #防止输入中只有n 1 没有 1 n的描述方式,其实这两种描述的意思是等价。 node_root[d[1]].appe...