给定存钱罐重量f - e,n种硬币的价值p,重量w。求里面最少有多少钱。
1.最少价值,全部初始化为inf,dp[0] = 0,转移的时候求min
2.装满背包,看dp[f - e] 是否仍为inf,是的话,说明背包不满。
#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
const int maxn = 500 + 5;
const int maxv = 10000 + 5;