摘要:
分层图最短路 #include<cstdio> #include<iostream> #include<cstring> #include<queue> using namespace std; const int N=50005; int n,m,k,tot; int head[N],dis[N] 阅读全文
摘要:
#include<cstdio> #include<iostream> #include<cmath> #include<algorithm> #include<cstring> using namespace std; const int N=500005; typedef long long l 阅读全文
摘要:
只要保证图是联通的,并且最小边权尽可能大,所以用最大生成树来建图,在图上用lca求最小边权,对路径上的点不断取min #include<cstdio> #include<iostream> #include<cstring> #include<algorithm> using namespace s 阅读全文
摘要:
LCA应用求最短路 #include<cstdio> #include<iostream> #include<cstring> using namespace std; const int N=40005; int T,n,m,ans,tot; struct node{ int to,next,w; 阅读全文