#C09L10P01. C09.L10.完全背包.引例1.货币系统.5

C09.L10.完全背包.引例1.货币系统.5

img

完善程序

#include<bits/stdc++.h>
using namespace std;
int n, v;
int a[35];
long long dp[10005];
int main()
{
	cin >> v >> n;
	__填空(1)__ = 1;
	for (int i=0;i<v;i++) {
		cin >> a[i];
		for (int j=__填空(2)__;__填空(3)__;__填空(4)__) {
			dp[j] += dp[j-a[i]];
		}
	}
	cout << dp[n] << endl;

	return 0;
}

填空(1):{{ input(1) }}

填空(2):{{ input(2) }}

填空(3):{{ input(3) }}

填空(4):{{ input(4) }}