2013年8月3日
摘要: 问题描述100元钱,有几种零钱,比如1元,5元,10元,求有几种组合分析时间复杂度O(m*n),空间复杂度O(n),完全背包问题代码如下 1 #include 2 #define N 100 3 int a[N + 5]; 4 int change[4]; //有几种零钱 5 //主功能函数,找到一共需要几种零钱 6 int findCount(int money, int countOfChange) 7 { 8 int i, j; 9 a[0] = 1;10 for (i = 1; i <= countOfChange; i++)11 {12 ... 阅读全文
posted @ 2013-08-03 15:42 MrMission 阅读(2318) 评论(0) 推荐(0) 编辑