![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
差分约束系统
zhhx2001
这个作者很懒,什么都没留下…
展开
-
bzoj3436(差分约束系统)
递归版的spfa,不了解其性质#include#include#include#include#include#includeusing namespace std;const int inf=0x3f3f3f3f;const int N=50005;int n,m;int head[50005],tot,dis[N],tt[N],flag;struct aa{ i原创 2016-08-21 10:41:25 · 403 阅读 · 0 评论 -
bzoj1731(差分约束系统,重点!)
这题就是裸的差分约束,但是特殊情况的判定值得学习。1:文中说“如果不存在满足要求的方案,输出-1;”bzoj2330中也说“如果不能满足小朋友们的所有要求,就输出-1。”不满足要求,在这类题中就表示,题目的信息是有矛盾的。其实就是,如果我们发现了负环,就说明:题目的信息有矛盾!2:文中说 "如果1号奶牛和N号奶牛间的距离可以任意大,输出-2"就是说信息无原创 2016-08-21 13:00:33 · 988 阅读 · 0 评论 -
差分约束的学习
http://www.cnblogs.com/void/archive/2011/08/26/2153928.html很好的概述实际上就是,这个系统通过,建图找最短路来解;模版题poj3159#include#include#include#include#include#include#includeusing namespace std;const int i原创 2016-04-29 21:24:26 · 317 阅读 · 0 评论