wjz 今年第7
页面 89 4043级训练
2023-10-30 12:57:31
|
|
5*1e9都能过
|
|
题目 3780 [CSP 2022J]上升点列
2022-10-30 03:14:51
|
|
题目 3619 [CSP 2021S]廊桥分配
2022-10-30 03:14:15
|
|
读入数据都要n的时间
题目 3209 二分查找
2022-08-19 13:11:12
|
|
数据已修改
题目 3721 物品染色
2022-08-18 22:10:39
|
|
牛
题目 3698 线段覆盖_
2022-07-03 20:56:19
|
|
#include<bits/stdc++.h>
using namespace std; int w[50000],c[50000],f[50000],N,V; int main(){ freopen("delicious.in","r",stdin); freopen("delicious.out","w",stdout); cin>>N>>V; for(int q=1;q<=N;q++) { cin>>w[q]>>c[q]; } for(int i=1;i<=N;i++) { for(int v=V;v>=w[i];v--) f[v]=max(f[v],f[v-w[i]]+c[i]); } cout<<f[V]; return 0; } |