摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3535题意:T时间内做一些任务,每个任务花费一些时间,获取一些快乐值,让快乐值最大。任务分成多组,每组三种情况之一:1.至少选一个 2.至多选一个 3.任意选两天敲了两遍,很经典的题,得好好搞清背包才好做代码:#include<iostream>#include<cstdio>#include<cstring>#include<string>#define inf (1<<28)#define nMAX 110int dp[2][nMAX],w[nM 阅读全文
posted @ 2012-10-18 23:43 快乐. 阅读(150) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1712m天复习n门课程,得分最高代码:#include<iostream>#include<cstdio>#include<string>#include<cstring>#define nMAX 110using namespace std;int dp[nMAX],val[nMAX];int main(){ int n,m,i,j,v; while(~scanf("%d%d",&n,&m)) { if(n==0&& 阅读全文
posted @ 2012-10-18 23:40 快乐. 阅读(131) 评论(0) 推荐(0) 编辑