
最短路径
bootdubbo
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
P4779 + HDU2544【堆优化Dijkstra模板】
这题为有向图 #include<bits/stdc++.h> using namespace std; #define maxn 1000010 #define INF 0x3f3f3f3f typedef long long ll; struct Edge{ int to,nxt; ll w; }edge[maxn<<2]; struct node{ ll w...原创 2019-10-09 17:42:01 · 167 阅读 · 0 评论 -
P4779【单源最短路径SPFA模板】
这题卡spfa #include<bits/stdc++.h> using namespace std; #define maxn 100010 #define INF 0x3f3f3f3f typedef long long ll; struct Edge{ int to,nxt; ll w; }edge[maxn<<2]; ll dis[maxn]; int n,m...原创 2019-10-09 17:54:46 · 198 阅读 · 0 评论 -
P2865【次短路模板】
dis[t][0]dis[t][0]dis[t][0]:表示 sss 到 ttt 的最短路; dis[t][1]dis[t][1]dis[t][1]:表示 sss 到 ttt 的次短路; #include<bits/stdc++.h> using namespace std; #define maxn 1000010 #define INF 0x3f3f3f3f typedef lon...原创 2019-10-09 20:35:22 · 142 阅读 · 0 评论 -
POJ-2449【k短路模板】
“Good man never makes girls wait or breaks an appointment!” said the mandarin duck father. Softly touching his little ducks’ head, he told them a story. “Prince Remmarguts lives in his kingdom UDF – U...原创 2019-10-10 20:22:21 · 196 阅读 · 0 评论 -
2018年沈阳网络赛D题【k短路模板题】
题意:给出n个点,m条边,起始点s,终点t,第k短路,最大代价e 如果第k短路的代价大于e或者没有第k短路就输出 Whitesnake! 否则输出 yareyaredawa; 注意的地方:yareyaredawa没有感叹号,多组输入 思路:k短路模板题 #include<bits/stdc++.h> using namespace std; #define maxn 100010 #d...原创 2019-10-10 20:50:39 · 492 阅读 · 0 评论 -
P2483【模板】k短路([SDOI2010]魔法猪学院)
题目描述 iPig在假期来到了传说中的魔法猪学院,开始为期两个月的魔法猪训练。经过了一周理论知识和一周基本魔法的学习之后,iPig对猪世界的世界本原有了很多的了解:众所周知,世界是由元素构成的;元素与元素之间可以互相转换;能量守恒……。 能量守恒……iPig 今天就在进行一个麻烦的测验。iPig 在之前的学习中已经知道了很多种元素,并学会了可以转化这些元素的魔法,每种魔法需要消耗 iPig 一定的...原创 2019-10-10 21:34:35 · 241 阅读 · 0 评论