Files
python/TangDou/AcWing/BeiBao/1021.cpp

22 lines
382 B
C++
Raw Normal View History

2025-08-30 18:35:01 +08:00
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 20;
const int M = 3010;
int n, m;
LL v[N];
LL f[M];
int main() {
cin >> n >> m;
f[0] = 1;
for (int i = 1; i <= n; i++) {
cin >> v[i];
for (int j = v[i]; j <= m; j++)
f[j] += f[j - v[i]];
}
printf("%lld\n", f[m]);
return 0;
}