
差分约束
Tsdmw&5t5
Emmmmmmm
展开
-
差分约束小小总结
①:对于差分不等式,a - b <= c ,建一条 b 到 a 的权值为 c 的边,求的是最短路,得到的是最大值②:对于不等式 a - b >= c ,建一条 b 到 a 的权值为 c 的边,求的是最长路,得到的是最小值 ③:存在负环的话是无解 ④:求不出最短路(dist[ ]没有得到更新)的话是任意解原创 2014-08-22 21:35:57 · 582 阅读 · 0 评论 -
Is the Information Reliable?
#include #include#include#include#define oo 1<<28#includestruct node{ int u; int v; int w; int next;} edge[1100000];int n,m;using namespace std;int cnt;int dis[5000];int h原创 2014-09-01 15:17:17 · 413 阅读 · 0 评论 -
Candies
#include #include#include#include#define oo 1<<28#includestruct node{ int u; int v; int w; int next;} edge[1100000];int n,m;using namespace std;int cnt;int dis[35000];int原创 2014-09-01 15:20:11 · 466 阅读 · 0 评论 -
Intervals
这个题开始用的简单队列,结果超时了,然后就用了数组来存。而且开始拉掉了一个条件s[i+1]-s[i]这个题有:0#include #include#include#include#include#define oo 1<<28#includestruct node{ int u; int v; int w; int next;} edg原创 2014-09-01 15:09:53 · 447 阅读 · 0 评论