差分约束的md
This commit is contained in:
parent
3dd15fd977
commit
3fc223a5ce
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
|
@ -0,0 +1,20 @@
|
||||||
|
# 差分约束
|
||||||
|
* https://vjudge.net/contest/509525#discuss
|
||||||
|
### 题意
|
||||||
|
不明所以
|
||||||
|
### 做法
|
||||||
|
* x1-x2<=w
|
||||||
|
* x1<=x2+w
|
||||||
|
* dist[v]<=dist[u]+w
|
||||||
|
* add(x2,x1,w);
|
||||||
|
* x1-x2>=1? add(x1,x2,-1);
|
||||||
|
* 最短路->最大值,反之亦然
|
||||||
|
![-1的示意图](-1.png)
|
||||||
|
### 关键词
|
||||||
|
数学,最短路,spfa
|
||||||
|
### 易错点
|
||||||
|
* 隐藏条件
|
||||||
|
* 构图
|
||||||
|
|
||||||
|
### 工具箱
|
||||||
|
* PPT
|
Loading…
Reference in New Issue