摘要:
给出几种硬币的价值以及他的数量,然后给出一个最大钱,问你所给的钱能组成1到最大钱的值有多少种?多重背包,直接套用多重的模版#include <stdio.h>#include <string.h>#define N 105#define M 100005#define MAX(a, b) (a > b ? a : b)int a[N], c[N], f[M];void Complete(int cost, int weight, int m){ for(int i = cost; i <= m; i++) f[i] = MAX(f[i], f[i - cos 阅读全文
posted @ 2011-05-08 23:31
void-man
阅读(305)
评论(0)
推荐(0)

浙公网安备 33010602011771号