摘要: #include #include #include using namespace std; int n,m,son[310][2],f[310][310],v[310],ans,falg; int init() { int x=0;char s;s=getchar(); while(s'9')s=getchar(); while(s>='0'&&sf[p][x])f[... 阅读全文
posted @ 2016-05-13 22:23 一入OI深似海 阅读(258) 评论(0) 推荐(0) 编辑
摘要: /* 查分约束. 给出的约束既有>= 又有=x 建边 a到b 权值为x Sb-Sa Sa-Sb>=-y 建边 b到a 权值为-y 然后跑最短路 SPFA 判断到不了终点 判断负环的死循环. */ #include #include #include #include #define maxn 20010 using namespace std; int n,m1,m2,num,head[m... 阅读全文
posted @ 2016-05-13 17:37 一入OI深似海 阅读(165) 评论(0) 推荐(0) 编辑
摘要: /* 数组开大保平安. 查分约束: 输入的时候维护st和end 设每个点取元素di个 维护元素个数前缀和s Sbi-Sai-1>=ci 即:建立一条从ai-1到bi的边 权值为ci 表示ai到bi的最小取元素个数 然后跑st到end的最长路 (建边就已经保证了最优) 最后 dis[end] 即为end的前缀和 即为st到end 符合每一个约束的最小去元素值 同时查分约束也满足性质 Sa... 阅读全文
posted @ 2016-05-13 17:03 一入OI深似海 阅读(162) 评论(0) 推荐(0) 编辑