当前位置:网站首页>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
边栏推荐
- 政务中台研究目的建设目标,建设意义,技术创新点,技术效果
- Complete binary search tree (30 points)
- 基于点云凸包的凹包获取方法
- Non duplicate data values of two MySQL query tables
- 搞不懂时间、时间戳、时区,快来看这篇
- OneFlow學習筆記:從Functor到OpExprInterpreter
- 小程序报错 :should have url attribute when using navigateTo, redirectTo or switchTab
- L2-022 重排链表 (25 分)(map+结构体模拟)
- Automatic differentiation and higher order derivative in deep learning framework
- How to read excel table to database
猜你喜欢

Solidity 问题汇总

PLC的点表(寄存器地址和点表定义)破解探测方案--方便工业互联网数据采集

Common errors of VMware building es8

请提前布局 Star Trek突破链游全新玩法,市场热度持续高涨

Multi view depth estimation by fusing single view depth probability with multi view geometry

valgrind和kcachegrind使用運行分析

2021 Li Hongyi's adaptive learning rate of machine learning

MySQL小练习(仅适合初学者,非初学者勿进)

First principle mind map

What is augmented reality technology? Where can it be used?
随机推荐
Go language self-study series | golang method
完全二叉搜索树 (30 分)
[indexof] [lastIndexOf] [split] [substring] usage details
单片机数码管秒表
Idea package jar file
微信:获取单个标签所有人
Matlab draw five-star red flag
valgrind和kcachegrind使用運行分析
根据后序和中序遍历输出先序遍历 (25 分)
深度学习框架中的自动微分及高阶导数
小程序报错 :should have url attribute when using navigateTo, redirectTo or switchTab
[Luke V0] verification environment 2 - Verification Environment components
js 原型链的深入
Is Zhongyan futures safe and reliable?
小女孩行走
OneFlow學習筆記:從Functor到OpExprInterpreter
1099 establish binary search tree (30 points)
npm ERR! network
Non duplicate data values of two MySQL query tables
Go language self-study series | initialization of golang structure