特征工程中,箱型图不一致
lx12633036 opened this issue · comments
LiXiang commented
:)s commented
已私聊解答
sunxiaojie commented
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
vector<int> price(n, 0);
for(int i = 0; i < n; ++i) {
cin >> price[i];
}
vector<int> dp(k + 1, 0);
for(int i = 0; i < n; ++i) {
for(int j = k; j >= price[i]; --j) {
dp[j] = max(dp[j], dp[j - price[i]] + 1);
}
}
cout << dp[k] << endl;
return 0;
}
在 2020-09-18 20:32:25,":)s" <notifications@github.com> 写道:
已私聊解答
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.