← 返回 microsoft 的题目列表Graph shortest path returning to origin
类型:online_judge
Given an undirected weighted graph, find the shortest path starting and returning to the same node, calculating the minimum weight sum of each path. If the path cannot return to the origin, return 0.
Example
Input
5 6
0 1 10
0 2 3
1 2 1
2 3 8
1 4 2
3 4 10
Output
24