随笔分类 -  图论--差分约束

摘要:Like everyone else, cows like to stand close to their friends when queuing for feed. FJ has N (2 <= N <= 1,000) cows numbered 1..N standing along a st 阅读全文
posted @ 2019-08-04 20:25 _Ackerman 阅读(313) 评论(0) 推荐(0)
摘要:During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of 阅读全文
posted @ 2019-08-04 00:54 _Ackerman 阅读(507) 评论(0) 推荐(0)
摘要:算法实现原理 由于我们只需要确定节点对(i,j)之间是存在i->j的路径,所以,对于松弛操作可以有两种优化方式,(1)将所有节点对之间的存在的直接连通的边权重设为1,不连通设为0。然后运行该算法,如果mp[i][j] = 1;则(i,j)之间存在一条简单路径。如果mp[i][j] = 0,则两者之间 阅读全文
posted @ 2019-07-30 10:18 _Ackerman 阅读(243) 评论(0) 推荐(0)
摘要:一类不等式组的解 给定n个变量和m个不等式,每个不等式形如 x[i] - x[j] <= a[k] (0 <= i, j < n, 0 <= k < m, a[k]已知),求 x[n-1] - x[0] 的最大值。例如当n = 4,m = 5,不等式组如图一-1-1所示的情况,求x3 - x0的最大 阅读全文
posted @ 2019-07-30 10:06 _Ackerman 阅读(282) 评论(0) 推荐(0)