题意:中文题目 思路:spfa+SLF优化.关于SPFA的详情请戳我 #include <bits/stdc++.h> using namespace std; , INF=0x7f7f7f7f; int n, m; bool vis[N]; //标记是否在队列中 int dest[N]; //路径长度 int mapp[N][N]; int spfa(int s, int e) //求最短路径 { memset(dest,0x7f,sizeof(dest)); dest[s]=; vis[s…
题目链接 Description Bessie has moved to a small farm and sometimes enjoys returning to visit one of her best friends. She does not want to get to her old home too quickly, because she likes the scenery along the way. She has decided to take the second-s…