摘要: 分层图最短路 #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] 阅读全文
posted @ 2021-05-30 20:45 dfydn 阅读(50) 评论(0) 推荐(0) 编辑
摘要: #include<cstdio> #include<iostream> #include<cmath> #include<algorithm> #include<cstring> using namespace std; const int N=500005; typedef long long l 阅读全文
posted @ 2021-05-30 20:15 dfydn 阅读(35) 评论(0) 推荐(0) 编辑
摘要: 只要保证图是联通的,并且最小边权尽可能大,所以用最大生成树来建图,在图上用lca求最小边权,对路径上的点不断取min #include<cstdio> #include<iostream> #include<cstring> #include<algorithm> using namespace s 阅读全文
posted @ 2021-05-30 18:53 dfydn 阅读(72) 评论(0) 推荐(0) 编辑
摘要: 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; 阅读全文
posted @ 2021-05-30 17:54 dfydn 阅读(41) 评论(0) 推荐(0) 编辑