采药-动态规划题解(C语言代码) 摘要:一看到题就发现这是动态规划,题目要求最大获利之类的时候也一般想到动态规划,动态规划的题就是用空间换取时间,建立一个表存储需要重复计算的自问题,表的最后一项的值就是我们要求的最优值。 动态规划的题先分…… 题解列表 2019年10月25日 0 点赞 0 评论 905 浏览 评分:8.4
采药-题解(C语言代码) 摘要:```c #include int max(int a, int b) { return a>b ? a:b; } int main() { int T, M, i,j; …… 题解列表 2019年08月28日 0 点赞 0 评论 1000 浏览 评分:6.0
采药-题解(Python代码) 摘要:写着玩的,大家凑合着看吧,哈哈哈 ```python timeout, num = 0, 0#记录时间上限和草药数量 t = [0]#记录每种草药的花费时间 v = [0]#记录每种草药的…… 题解列表 2019年06月17日 0 点赞 0 评论 1834 浏览 评分:9.0
采药 (C语言代码) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int max(int a, int b){ return a>b ? a:b;}int main(){ int T, M,…… 题解列表 2019年05月21日 0 点赞 0 评论 1425 浏览 评分:0.0
采药 (看楼上大佬的就行,我只是留一下足迹) 摘要:解题思路:注意事项:参考代码:#include <stdio.h>#define max(x,y) (x)>(y)?(x):(y) int main(){ int dp[102][1001]={0},…… 题解列表 2019年05月06日 0 点赞 0 评论 887 浏览 评分:0.0
采药 (C语言代码) 摘要:解题思路:虽然超时了,不过还想贴一下昂递归思路来做的把所有可能性算一遍,暴力了一点注意事项:参考代码:#include<stdio.h>#include<string.h>struct node{ i…… 题解列表 2019年04月18日 0 点赞 0 评论 987 浏览 评分:0.0
采药 (C语言代码) 摘要:解题思路:贴段代码注意事项:参考代码:#include<stdio.h>#include<string.h>int A[150],B[150],C[1500];int main(){ int N,M,…… 题解列表 2019年04月18日 0 点赞 0 评论 961 浏览 评分:0.0
采药 (C++代码)DP(动态规划) 摘要:解题思路: 标准的01背包问题。参考代码:#include<iostream> #include<cmath> #define hh ios::sync_with_stdio(false),…… 题解列表 2019年03月23日 0 点赞 0 评论 968 浏览 评分:0.0
采药 (C++代码) 摘要:解题思路:0/1背包问题,动态规划解决注意事项:参考代码:#include<iostream>#include<string.h>using namespace std;#define maxn 10…… 题解列表 2019年03月23日 0 点赞 0 评论 854 浏览 评分:0.0
采药 (C++代码) 摘要:解题思路: 0/1背包问题参考代码:#include <iostream> #include<cmath> using namespace std; int T,M,ValueSum; in…… 题解列表 2019年03月18日 0 点赞 0 评论 654 浏览 评分:0.0