2022-08-15 21:38:09 +08:00

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

# B - House Man
* https://vjudge.net/contest/509525#problem/B
### 题意
给定有一定顺序的一组数要求从小到大走最大跨D这么远即A到B中间最多隔着D-1问能否走到最小和最大的最大距离多少
### 做法
差分约束1.原来顺序左到右>=1;2.小到大再按原来的左到右<=D
max,min中原来id小的做S,id大的做T;dist[T]就是答案
### 关键词
差分约束,构图,源点,汇点
### 易错点
构图,还是不是很理解
//TLE 判断负环的(been/times)放错位置
cnt=0;//WA罪魁祸首! 没有每次赋零
scanf("%d",&a[i].h);//怎么总是你&
wa=0;//WA bool标记忘了每次赋零
### 工具箱
*