好像没有缩进了 全给替换成-了
n, m = tuple([int(x) for x in input().split()])
path = []
dist = [0]+[1e9]*(n-1)
guarantee = []
unguarantee = [i+1 for i in range(n)]
for i in range(m):
-path.append(tuple([int(p) for p in input().split()]))
for i in range(n):
-temp = [dist[i-1] for i in unguarantee]
-min1 = min(temp)
-pos = temp.index(min1)
-up_date = unguarantee[pos]
-for x, y, z in path:
–if x == up_date:
—dist[y-1] = min(dist[y-1], dist[x-1]+z)
-guarantee.append(up_date)
-unguarantee.remove(up_date)
print(-1 if dist[-1] == 1e9 else dist[-1])