#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;
}
蓝桥杯刷题-货币系统
最新推荐文章于 2024-07-18 19:57:00 发布