版本比较
图-最短路
正文
增加 12 行删除 8 行
16 行未改动1718192021212223242565 行未改动919293949595969797989910010121 行未改动12312412512612712712812913013131 行未改动163164165166167167168169170171330 行未改动全部展开50250350450550650750650950750850951051151251316 行未改动>>### 时间复杂度:>>>#### 一次是$O(n^2)$>>>#### 总共就是$O(n^2+m)$=$O(n^2)$>>### 适用:>>>### 非负 $\,\,\,\color{transparent}就没了,想不出来了(bushi$>>>### 非负 $\,\,\,\color{transparent}就没了,实在想不出来了$>>### 代码实现::::success[代码]```cpppriority_queue<pii,vector<pii>,greater<pii> >q;65 行未改动 else cout<<dis[n]; return 0;}```$\color{transparent}{没注释!!!!!!!!!!(doge}$$\color{transparent}{没注释:)}$:::>## 2.$Floyd$算法$\color{transparent}没有spfa因为没记(doge$>## 2.$Floyd$算法$\color{transparent}没有spfa因为没记$>>### $\color{transparent}没用的:$~~Floyd 这个名字的来源是威尔士语的 Llwyd,字面意思是“灰色”。这个名字强调了中性和稳定的特质,常被视为勇敢、有智慧、直率、充满创造力的人。~~>>### 方法:>>>#### 建一个二维数组$g[i][j]$表示从i到j的距离>>>#### 然后枚举中转点$k$21 行未改动}```### 此时$g[i][j]$就是$i$到$j$的最短距离:::>>### 例题:[送信](http://bbcoj.cn/problem/BD205) >>### 例题:[送信](http://bbcoj.cn/problem/BD205):::success[]```cpp#include<bits/stdc++.h>using namespace std;31 行未改动 cout<<ans; return 0;}```$\color{transparent}嗯对,依旧没有注释$$\color{transparent}依旧没有注释$:::# 详情请参考[$\mathscr {OI}$-$\mathscr {WIKI}$](https://oi-wiki.org/graph/shortest-path/)###### ~~$~~\tiny好像看不出来是什么。。。~~$~~[](dttps://oi-wiki.org)330 行未改动全部展开
$\color{transparent}11$
$\color{transparent}11$
$\color{transparent}11$### 还有一个spfa## 只能借鉴神犇的了:[关于spfa,它死了](https://www.luogu.me/article/v4dm1m6a)## 只能借鉴神犇的了:
[](https://www.luogu.me/article/v4dm1m6a)
:::align{center}# $\Huge\mathcal{THE}\,\,\,\mathcal{END}$