1371. 货币系统 - AcWing题库
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 30;
LL v , n;
LL f[10010];
LL ways = 0;
int main()
{
cin >> v >> n;
f[0] = 1; //初始化 f[0][0] = 1
for(int i = 1; i <= v; i++)
{
int v;
cin>>v;
for(int j = v; j <= n; j++)
f[j] += f[j-v]; // 状态计算方程
}
cout << f[n];
return 0;
}