摘要:
题意: 有 n 个物品,有主件附件之分,买附件必须先买主件,问最后可以得到的价值最大是多少?分析: 分组背包的变形。View Code #include<stdio.h>#include<string.h>#define max(a,b)(a)>(b)?(a):(b)int w[100];struct node{ int to,next;}q[100];int head[61];int num[61];int tot;void add(int s,int u){ q[tot].to=u; q[tot].next=head[s]; head[s]=tot++;}in 阅读全文
posted @ 2012-05-02 20:17
'wind
阅读(328)
评论(0)
推荐(0)


浙公网安备 33010602011771号