记录一下大佬的解题方法(采药) 摘要:解题思路:创建M行T列的二位数组,I行,j为0-T,为所有i行j时间下的赋value值,具体如下j-time[i]是剩余可用时间,而上一层Sum_V[i - 1]记录了在i-1个草药下,所有T时间内所…… 题解列表 2024年04月07日 0 点赞 0 评论 396 浏览 评分:0.0
0/1背包问题,递归求解,动态规划 摘要:朴素递归算法(时间超限)参考代码:#include <stdio.h> int t,m; typedef struct Item { int time; int va…… 题解列表 2019年01月06日 0 点赞 0 评论 811 浏览 评分:0.0
采药 (C++代码)DP(动态规划) 摘要:解题思路: 标准的01背包问题。参考代码:#include<iostream> #include<cmath> #define hh ios::sync_with_stdio(false),…… 题解列表 2019年03月23日 0 点赞 0 评论 997 浏览 评分:0.0
编写题解 1100: 采药 摘要:解题思路:1把大问题转换成小问题,然后递归.2写出最小问题的初始状态。3用一个数组记录各层问题的中间计算结果,避免重复计算。参考代码:#include <stdio.h> #include <std…… 题解列表 2024年07月10日 0 点赞 0 评论 333 浏览 评分:0.0
采药 (C语言代码) 摘要:解题思路:使用结构体数组运算,创建一个价值除以时间的百分比量q,用这个q进行比较,排序,最后提取前几个时间加起来小于time就可以。注意事项:并不完善,成功率91%;因为有一些用double算不完全,…… 题解列表 2019年02月27日 0 点赞 0 评论 576 浏览 评分: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 评论 989 浏览 评分:0.0
采药 (C语言代码) 摘要:解题思路:虽然超时了,不过还想贴一下昂递归思路来做的把所有可能性算一遍,暴力了一点注意事项:参考代码:#include<stdio.h>#include<string.h>struct node{ i…… 题解列表 2019年04月18日 0 点赞 0 评论 1013 浏览 评分: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 评论 912 浏览 评分:0.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 评论 1471 浏览 评分:0.0
1100: 采药一眼丁真 摘要:解题思路:01背包注意事项:数组大小和动态规则参考代码:#include<stdio.h> #define max(x,y) ((x)>(y)?(x):(y)) int main(){ int…… 题解列表 2024年11月19日 2 点赞 0 评论 581 浏览 评分:0.0