摘要: Gy最近学习了01背包问题,无聊的他又想到了一个新的问题,给定n个物品的价值,和01背包一样,每个物品只能选1次或0次,求最小不能被得到的价值。输入第一行一个正整数T(T#include#define N 110int a[N];int cmp(const void *a,const void *b... 阅读全文
posted @ 2014-04-22 16:13 HYDhyd 阅读(124) 评论(0) 推荐(0) 编辑
摘要: #include#include#define N 1100int c[N];int main() {int l,n,i,m,a,b,front[N],tail[N];while(scanf("%d%d",&l,&n)!=EOF) {for(i=0;i=0;i--) { b++; if(c[i]ta... 阅读全文
posted @ 2014-04-22 11:15 HYDhyd 阅读(90) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#includeusing namespace std;#define inf 1000000000#define N 110000struct node {int u,v,w,next;}bian[N*2];int head[N],yong,mind... 阅读全文
posted @ 2014-04-22 10:49 HYDhyd 阅读(110) 评论(0) 推荐(0) 编辑