题目链接:https://cn.vjudge.net/contest/276233#problem/I 题目大意:输入k和n,然后输入n行,每一次输入两个数,代表开端和结尾,如果这个区间内点的个数大于等于k,那么就要求这个区间至少有k个点被圈起来,如果这个区间内的点的个数小于k,就要求这个区间内的点全部被包括起来,然后问你最多需要多少点? 具体思路:正常的建图方式,为了使得路径输出的时候,方便利用数组,我们可以直接在原来的基础上加上10000,这样的化就可以用数组记录到底有还是没有了.路径输出的…
题目链接:https://cn.vjudge.net/contest/276233#problem/A 差分约束系统,假设当前有三个不等式 x- y <=t1 y-z<=t2 x-z<=t3 我们可以将第一个式子和第二个式子结合起来,就变成了x-z<= t1+t2 ,然后x-z的最大差值就是min(t1+t2,t3)(因为要使得最终结果都满足两个不等式) 然后求最小的过程(求差最大),就可以通过最短路的算法实现. 题目大意:给你n代表有n头牛,然后ml和md,接下来ml行,每行有三…
POJ 3159 Candies (图论,差分约束系统,最短路) Description 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 candies and had flymouse distribute them. All the kids…
id=1716">[POJ 1716]Integer Intervals(差分约束系统) Integer Intervals Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 13425   Accepted: 5703 Description An integer interval [a,b], a < b, is a set of all consecutive integers beginning with…
[POJ 1275] Cashier Employment(差分约束系统的建立和求解) Cashier Employment Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 7569   Accepted: 2856 Description A supermarket in Tehran is open 24 hours a day every day and needs a number of cashiers to f…
id=2983">[POJ 2983]Is the Information Reliable? (差分约束系统) Is the Information Reliable? Time Limit: 3000MS   Memory Limit: 131072K Total Submissions: 12244   Accepted: 3861 Description The galaxy war between the Empire Draco and the Commonwealth of…
[POJ 1201] Intervals(差分约束系统) 11 1716的升级版 把原本固定的边权改为不固定. Intervals Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 23817   Accepted: 9023 Description You are given n closed, integer intervals [ai, bi] and n integers c1, ..., cn. Write a p…
Layout 题目链接: Rhttp://acm.hust.edu.cn/vjudge/contest/122685#problem/S Description 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 straight line waitin…
介绍下差分约束系统:就是多个2未知数不等式形如(a-b<=k)的形式 问你有没有解,或者求两个未知数的最大差或者最小差 转化为最短路(或最长路) 1:求最小差的时候,不等式转化为b-a>=k的标准形式建图,求最长路 2:求最大差的时候,不等式转化为b-a<=k的标准形式建图,求最短路 然后具体的写的好的博客以供大家参考 1 http://www.cnblogs.com/void/archive/2011/08/26/2153928.html 2 http://blog.csdn.net/…
Description You are given two pots, having the volume of A and B liters respectively. The following operations can be performed: FILL(i) fill the pot i ( ≤ i ≤ ) from the tap; DROP(i) empty the pot i to the drain; POUR(i,j) pour from pot i to pot j;…