题解 1100: 采药

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

1100采药(dp记忆化搜索)

摘要:解题思路:注意事项:参考代码:#include<iostream>#include<algorithm>#include<cstring>using namespace std;const int M……

编写题解 1100: 采药

摘要:解题思路:1把大问题转换成小问题,然后递归.2写出最小问题的初始状态。3用一个数组记录各层问题的中间计算结果,避免重复计算。参考代码:#include <stdio.h> #include <std……

1100: 采药(背包问题)

摘要:核心:0-1背包问题,设置二维数组dp[i][j], dp[i][j] = max(dp[i-1][j], dp[i-1][j-wi]+vi)代码:T, M = map(int, input().sp……

1100: 采药一眼丁真

摘要:解题思路:01背包注意事项:数组大小和动态规则参考代码:#include<stdio.h> #define max(x,y) ((x)>(y)?(x):(y)) int main(){ int……

采药 , 结构求解,简单

摘要:解题思路:注意事项:参考代码:#include <stdlib.h>struct Medicine{ int time; int value;};int main(){ struct Medicine……