![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
最短路
Ramzes_666_fan
这个作者很懒,什么都没留下…
展开
-
最短路(spfa)判断负环(dfs or bfs)
L - The Shortest PathYou are given a directed weighted graph withNnodes andMedges. Your task is to find the minimum shortest path between any pair of nodes in the graph. As the weight of the edg...原创 2020-02-10 12:10:47 · 267 阅读 · 0 评论 -
最短路(dijstra)
邻接表+优先队列(无负边)求单源点的最短距离:有一个n个点,m条边的图,问s->t;的最短距离:代码:#include<bits/stdc++.h>#define ios() ios::sync_with_stdio(false);cin.tie(0); cout.tie(0);using namespace std;typedef long long ll;...原创 2020-02-07 17:28:21 · 93 阅读 · 0 评论