![](https://img-blog.csdnimg.cn/20190927151043371.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
sortest path
a
aWty_
在 AFO 的边缘徘徊的 OIer
展开
-
差分约束算法
差分约束算法 模板传送门: luogu5960 差分约束题目描述 给出一组包含 mmm 个不等式,nnn 个未知数的形如:{xc1−xc1′≤y1xc2−xc2′≤y2xc3−xc3′≤y3⋮xcm−xcm′≤ym\begin{cases}x_{c_1} - x_{c_1}' \leq y_1 \\x_{c_2} - x_{c_2}' \leq y_2 \\x_{c_3} - x_{c_3}' \leq y_3 \\\vdots \\x_{c_m} - x_{c_m}' \leq y原创 2022-05-13 19:47:10 · 139 阅读 · 0 评论 -
SPFA.
SPFA#include<bits/stdc++.h>using namespace std;#define MAXN 10010#define MAXM MAXN * (MAXN-1)int n = 0, m = 0, s = 0;int tot = 0;int first[MAXN] = { 0 };int nxt[MAXM] = { 0 };int to[MAXM] = { 0 };int value[MAXM] = { 0 };void add(i原创 2021-10-13 22:59:52 · 60 阅读 · 0 评论 -
Floyd
Floyd#include<bits/stdc++.h>using namespace std;#define MAXN 1010/* 图中最短路 f[i][j] = gragh[i][j] = min{f[i][k] + f[k][j], f[i][j]}*/int n = 0;int gragh[MAXN][MAXN] = { 0 };int f[MAXN][MAXN] = { 0 };void floyd(){原创 2021-10-13 22:56:21 · 71 阅读 · 0 评论 -
Dijkstra+堆优化
dijkstra + 堆优化#include<bits/stdc++.h>using namespace std;#define MAXN 100100#define MAXM 2 * MAXNint n = 0; int m = 0;int tot = 0;int first[MAXN] = { 0 };int nxt[MAXM] = { 0 };int to[MAXM] = { 0 };int value[MAXM] = { 0 };void add(原创 2021-10-13 22:51:29 · 78 阅读 · 0 评论