摘要: http://ac.jobdu.com/problem.php?id=1364经典01背包,没有用空间逆序优化。 1 #include <stdio.h> 2 #include <string.h> 3 #include <stdlib.h> 4 int S,C; 5 int force[102]; 6 int space[102]; 7 int mat[102][1002]; 8 int max(int a,int b) 9 {10 return a>b?a:b;11 }12 int main()13 {14 while(scanf("%d 阅读全文
posted @ 2011-12-27 16:21 linyvxiang 阅读(176) 评论(0) 推荐(0) 编辑
摘要: http://ac.jobdu.com/problem.php?id=1363按规则来就可以 注意,可能有多副牌 一开始按一副牌处理的,一个数据也过不了 另外,还有 每次找两个相同的牌时,从3开始找,找不到再去1和2中找。代码写的比较乱,大概是好久不写的缘故. 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <string.h> 4 int N; 5 int num_count[20]; 6 int comp[5]; 7 int main() 8 { 9 10 while(scanf("% 阅读全文
posted @ 2011-12-27 09:41 linyvxiang 阅读(233) 评论(0) 推荐(0) 编辑