2012年8月10日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1712赤裸裸的分组背包View Code #include <iostream>using namespace std ;int dp[101] ;int val[101][101] ;int main(){ int n,m ; while(scanf("%d%d",&n,&m),(n||m)) { for(int i=1;i<=n;i++) for(int j=1;j<=m;j++) scanf("%d",&val[i] 阅读全文
posted @ 2012-08-10 17:14 LegendaryAC 阅读(147) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2159二维费用的背包wa了好多次,要求最大忍耐度,开始没处理好,想当然了View Code #include <iostream>using namespace std ;int dp[101][101] ;int w[101],c[101] ;int main(){ int n,m,k,s ; while(~scanf("%d%d%d%d",&n,&m,&k,&s)) { for(int i=0;i<k;i++) scanf(" 阅读全文
posted @ 2012-08-10 15:44 LegendaryAC 阅读(132) 评论(0) 推荐(0) 编辑