上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 13 下一页
摘要: 【题目大意】有M个项目和N个员工。做项目i可以获得Ai元,但是必须雇用若干个指定的员工。雇用员工j需要花费Bj元,且一旦雇用,员工j可以参加多个项目的开发。问经过合理的项目取舍,最多能挣多少钱。(1 2 #include 3 #include 4 #include 5 #include 6 #in... 阅读全文
posted @ 2015-12-28 20:24 onlyRP 阅读(381) 评论(0) 推荐(0) 编辑
摘要: 这题表面上看上去有些无从下手。。但只需去掉所给边为最大(小)的环就可以了然后要挑出比所给边大(小)的边建图找最小割即可要把最大和最小生成树分开做(一开始想一起合着做但这图明显不对呀) 1 #include 2 #define inc(i,l,r) for(int i=l;i=r;i--) 4 #de... 阅读全文
posted @ 2015-12-25 23:59 onlyRP 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 过得好辛苦,T了一版QAQ思路不难想,先spfa然后把最短路挑出来再来个最大流。。然而我却把最短路和最大流混在一起做,怪不得那么慢。。花了好多时间啊QAQ叫我偷懒 叫我偷懒 叫我偷懒 1 #include 2 #define inc(i,l,r) for(int i=l;i=r;i--) 4 #de... 阅读全文
posted @ 2015-12-25 20:55 onlyRP 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 最小割。。S和1连边,T和0连边,再连u和v,容量均为1(怎么有二分图的味道。。)不过一开始是想要拆点乱搞,然后发现边好像有点多(其实简化下图就可以了)双倍经验怎能错过2333 1 #include 2 #define inc(i,l,r) for(int i=l;i=r;i--) 4 #defin... 阅读全文
posted @ 2015-12-24 20:34 onlyRP 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 状压DP,以前这题TLE,改了好久才改好(还不如重写QAQ) 1 //#include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #define inc(i,l,r) for(int i=l;i=r;i--) 9 #define... 阅读全文
posted @ 2015-12-22 19:57 onlyRP 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 三进制状压DP,预处理就可以了,不过数据好大好难调。。没注意重边WA了一版。。不会生出图的数据,就干脆建了个完全图 1 //#include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #define inc(i,l,r) for... 阅读全文
posted @ 2015-12-21 18:46 onlyRP 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 状压DP,数组范围没注意,搞了半天QAQ感觉状压DP挺难调的 1 #include 2 #define inc(i,l,r) for(int i=l;i=r;i--) 4 #define link(x) for(edge *j=h[x];j;j=j->next) 5 #define mem(a) m... 阅读全文
posted @ 2015-12-18 22:45 onlyRP 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 挺基础挺经典的状压DP,叫TSP来着? 1 //#include<bits/stdc++.h> 2 #include<cstdio> 3 #include<cstring> 4 #include<iostream> 5 #include<queue> 6 #include<algorithm> 7 阅读全文
posted @ 2015-12-18 21:08 onlyRP 阅读(172) 评论(2) 推荐(0) 编辑
摘要: 状压DP。。。没好好去想转移方程推掉了重写QAQ对状态数目的优化还是挺牛的orz 1 //#include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #define inc(i,l,r) for(int i=l;i=r;i--)... 阅读全文
posted @ 2015-12-18 20:33 onlyRP 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 状压DP。位运算真是弱项 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define inc(i,l,r) for(int i=l;i=r;i--) 8 #define link(x) for(edge *j=h[x];j;j=j... 阅读全文
posted @ 2015-12-17 21:57 onlyRP 阅读(133) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 13 下一页