'commit'
This commit is contained in:
22
TangDou/BeiBao/PlanCount/Wq_Below2.cpp
Normal file
22
TangDou/BeiBao/PlanCount/Wq_Below2.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
const int N = 110;
|
||||
|
||||
int n, m;
|
||||
int f[N][N];
|
||||
|
||||
int main() {
|
||||
cin >> n >> m;
|
||||
for (int i = 0; i <= m; i++) f[0][i] = 1;
|
||||
for (int i = 1; i <= n; i++) {
|
||||
int v;
|
||||
cin >> v;
|
||||
for (int j = 0; j <= m; j++) {
|
||||
f[i][j] = f[i - 1][j];
|
||||
if (j >= v) f[i][j] += f[i][j - v];
|
||||
}
|
||||
}
|
||||
cout << f[n][m] << endl;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user