#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const int N=2e2+9;
ll dp[N];
int main()
{
int n,m;cin>>n>>m;
for(int i=1;i<=n;i++)
{
ll w,v,s;cin>>w>>v>>s;
while(s--)
{
for(int j=m;j>=w;j--)
{
dp[j]=max(dp[j],dp[j-w]+v);
}
}
}
cout<<dp[m]<<endl;
return 0;
}
多重背包 小明的背包3
最新推荐文章于 2025-12-20 17:21:30 发布

244

被折叠的 条评论
为什么被折叠?



