0/1背包问题,递归求解,动态规划 摘要:朴素递归算法(时间超限)参考代码:#include <stdio.h> int t,m; typedef struct Item { int time; int va…… 题解列表 2019年01月06日 0 点赞 0 评论 546 浏览 评分:0.0
采药 (C++代码)DP(动态规划) 摘要:解题思路: 标准的01背包问题。参考代码:#include<iostream> #include<cmath> #define hh ios::sync_with_stdio(false),…… 题解列表 2019年03月23日 0 点赞 0 评论 634 浏览 评分:0.0
采药 (C语言代码) 摘要:解题思路:使用结构体数组运算,创建一个价值除以时间的百分比量q,用这个q进行比较,排序,最后提取前几个时间加起来小于time就可以。注意事项:并不完善,成功率91%;因为有一些用double算不完全,…… 题解列表 2019年02月27日 0 点赞 0 评论 397 浏览 评分:0.0
采药 (C++代码) 摘要:解题思路: 0/1背包问题参考代码:#include <iostream> #include<cmath> using namespace std; int T,M,ValueSum; in…… 题解列表 2019年03月18日 0 点赞 0 评论 380 浏览 评分:0.0
采药 (C++代码) 摘要:解题思路:0/1背包问题,动态规划解决注意事项:参考代码:#include<iostream>#include<string.h>using namespace std;#define maxn 10…… 题解列表 2019年03月23日 0 点赞 0 评论 557 浏览 评分: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 评论 499 浏览 评分:0.0
采药 (C语言代码) 摘要:解题思路:虽然超时了,不过还想贴一下昂递归思路来做的把所有可能性算一遍,暴力了一点注意事项:参考代码:#include<stdio.h>#include<string.h>struct node{ i…… 题解列表 2019年04月18日 0 点赞 0 评论 557 浏览 评分: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 评论 520 浏览 评分: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 评论 624 浏览 评分:0.0
采药-题解(C语言代码) 摘要:```c #include int K[101][1000]; //前者是数目,后者是时间,这个数组用于计算各个状态(已考虑的放入的第x个药,总时间为y)下的最大价值 int …… 题解列表 2019年11月27日 0 点赞 0 评论 495 浏览 评分:0.0