Scandinavians often make vacation during the Easter holidays in the largest ski resort Are. Are provides fantastic ski conditions, many ski lifts and slopes of various difficulty profiles. However, some lifts go faster than others, and some are so po…
直接floyd.. ----------------------------------------------------------------------- #include<cstdio> #include<cstring> #include<algorithm> #include<iostream> #include<vector> #define rep( i , n ) for( int i = 0 ; i < n ; +…
给出n个点的无向图,每条边有两个属性,边权和代价. 第一问求1-n的最短路.第二问求用最小的代价删边使得最短路的距离变大. 对于第二问.显然该删除的是出现在最短路径上的边.如果我们将图用最短路跑一遍预处理出所有最短路径. 然后我们要删除的边集一定是这个图的一个割.否则最短路径不会增加.即求此图的最小割. # include <cstdio> # include <cstring> # include <cstdlib> # include <iostream>…