P2136 拉近距离

Jalen at 
P2136 拉近距离的配图
思路我是源点,你是终点。我们之间有负权环。 ——小明负环的 经验题 and 语文阅读理解?此题中的 w 为减少的距离,与正常的不同。结合输入输出输入样例 3 31 2 32 3 -13 1 -10 输出-2 再画两张图这时你就会发现只需将 -w 当作权值进行最短路运算即可#include #include #include #include #define MAXN 5010#define MAXM 50010const int INF = 1e9;using namespace std;int n,m,u,v,w,cnt,T;int head[MAXN],dis[MAXN],vis[MAXN……