#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<cstdlib>
using namespace std;
const int M=35;
int s[M];
int n, v;
long long f[10005];
void solve()
{
memset(f, 0, sizeof(f));
f[0]=1;
for (int i=1; i<=n; i++)
for (int j=s[i]; j<=v; j++)
f[j]=f[j-s[i]]+f[j];
printf("%lld",f[v]);
}
void init()
{
scanf("%d %d", &n, &v);
for (int i=1; i<=n; i++)
scanf("%d", &s[i]);
}
int main()
{
init();
solve();
return 0;
}
CodeVs 2054 货币系统
最新推荐文章于 2019-03-06 19:15:00 发布