本题尚未理解,搬运他人代码标记一下 n, m = map(int,input().split()) primary, annex = {}, {} for i in range(1,m+1): x, y, z = map(int, input().split()) if z==0: primary[i] = [x, y] else: if z in annex: annex[z].append([x, y]) else: annex[z] = [[x,y]] dp = [0]...