holiday/8.15/F-Candies/Readme.md
2022-08-15 21:14:35 +08:00

17 lines
522 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.

# F - Candies
* https://vjudge.net/contest/509525#problem/F
### 题意
给定m对A认为B可以比他大C,求编号1与编号n的最大差距
### 做法
差分约束、单源最短路
### 关键词
差分约束、sfpa、inf、memset
### 易错点
//WA int和bool放一起了
dist[s] = 0;//和賦inf顺序反了=白干
stack<int> q; // queue没有自带函数清零
in[u] = 0; // spfa的精髓不要忘了每次弹出
// n,m不分
### 工具箱
* memset(dist,0x3f,sizeof dist);//更好的賦初值方法 https://www.cnblogs.com/td15980891505/p/5431898.html
* queue<int> q; // queue没有自带函数清零,每次重开就行