5137专题

How Many Maos Does the Guanxi Worth HDU - 5137(最短路)

“Guanxi” is a very important word in Chinese. It kind of means “relationship” or “contact”. Guanxi can be based on friendship, but also can be built on money. So Chinese often say “I don’t have one ma

HDU 5137 How Many Maos Does the Guanxi Worth(枚举+最短路径)

题目:点击打开链接   题意:给出一个无向图n个点m条边,断开其中的除了1和n之外的其中一个点的所有边,让最短路最长。 思路:依次枚举除了1和n之外的其中一个点的所有边的最短路的结果,并且求出最大值。 代码: #include<iostream>#include<cstring>#include<algorithm>using namespace std;#define INF