当前位置:网站首页>2D 01 Backpack
2D 01 Backpack
2022-04-23 09:03:00 【2020100XWH】
Direct two-dimensional reverse enumeration
#include<bits/stdc++.h>
using namespace std;
int dp[205][205];
int main()
{
int n,m,t;
cin>>n>>m>>t;
int mm[105],tt[105];
for(int i=1;i<=n;++i)
{
cin>>mm[i]>>tt[i];
}
for(int i=1;i<=n;++i)
{
for(int j=m;j>=mm[i];--j)
{
for(int k=t;k>=tt[i];--k)
{
dp[j][k]=max(dp[j][k],dp[j-mm[i]][k-tt[i]]+1);
}
}
}
cout<<dp[m][t];
return 0;
}
版权声明
本文为[2020100XWH]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230721150251.html
边栏推荐
- 搞不懂时间、时间戳、时区,快来看这篇
- 搜索树判断 (25 分)
- Production practice elk
- Experimental report on analysis of overflow vulnerability of assembly language and reverse engineering stack
- Go language self-study series | golang structure as function parameter
- Resource packaging dependency tree
- Wechat: get the owner of a single tag
- [boutique] using dynamic agent to realize unified transaction management II
- 深度学习框架中的自动微分及高阶导数
- PLC point table (register address and point table definition) cracking detection scheme -- convenient for industrial Internet data acquisition
猜你喜欢
PLC的点表(寄存器地址和点表定义)破解探测方案--方便工业互联网数据采集
bashdb下载安装
资源打包关系依赖树
npm报错 :operation not permitted, mkdir ‘C: \Program Files \node js \node_ cache _ cacache’
Harbor enterprise image management system
To remember the composition ~ the pre order traversal of binary tree
L2-022 重排链表 (25 分)(map+结构体模拟)
node安装
Write down the post order traversal of the ~ binary tree
Production practice elk
随机推荐
L2-3 浪漫侧影 (25 分)
Matlab draw five-star red flag
OneFlow學習筆記:從Functor到OpExprInterpreter
Consensus Token:web3.0生态流量的超级入口
Study notes of deep learning (8)
L2-3 romantic silhouette (25 points)
The K neighbors of each sample are obtained by packet switching
1099 establish binary search tree (30 points)
小程序报错 :should have url attribute when using navigateTo, redirectTo or switchTab
Brief steps to build a website / application using flash and H5
npm报错 :operation not permitted, mkdir ‘C: \Program Files \node js \node_ cache _ cacache’
Non duplicate data values of two MySQL query tables
Download and install bashdb
计算神经网络推理时间的正确方法
Data visualization: use Excel to make radar chart
LeetCode_ DFS_ Medium_ 1254. Count the number of closed islands
tsdf +mvs
基于点云凸包的凹包获取方法
还原二叉树 (25 分)
2022-04-22 openebs cloud native storage