holiday/8.15/Readme.md
2022-08-15 21:52:38 +08:00

20 lines
293 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 差分约束
* 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