采药 (C语言代码) 摘要:解题思路:建议大家看一下0-1背包问题(在这里一时半会也说不清楚,我看了好几天才明白一点,有点笨,哈哈^*_*^),然后利用一维状态转移方程f[i]=max(f[i],f[i-w[j]]+p[j])(…… 题解列表 2018年06月09日 0 点赞 0 评论 779 浏览 评分:0.0
采药 (C语言代码) 摘要:解题思路:注意事项:参考代码:#include <cstdlib>#include<iostream>using namespace std;int s[1001];int main(int argc…… 题解列表 2018年07月04日 0 点赞 0 评论 452 浏览 评分:0.0
采药 (C语言代码) 摘要:解题思路:注意事项:参考代码:#include <stdio.h>void main(){ int max,a[100][2],T,M,i,j,s,t; scanf("%d %d",&T,&M); f…… 题解列表 2018年08月18日 0 点赞 0 评论 703 浏览 评分:0.0
采药 (C++代码) 摘要:解题思路:dp注意事项:1.优化二维数组至一维,就不需要写if判断了,否则需要像地表最强召唤兽那样写if,否则空间不足时的总价格就不会被计算还是0,导致答案错误2.数组大小要开足参考代码:#defin…… 题解列表 2018年11月01日 0 点赞 0 评论 529 浏览 评分:0.0
采药 (C语言代码) 摘要:解题思路:注意事项:参考代码:#include <cstdio> #include <cstring> #include <string> #include <cmath> #include …… 题解列表 2018年11月07日 0 点赞 0 评论 468 浏览 评分:0.0
采药 (C语言代码)DP 摘要:解题思路:注意事项:参考代码:#include <cstdio> #include <cstring> #include <string> #include <cmath> #include …… 题解列表 2018年11月07日 0 点赞 0 评论 421 浏览 评分:0.0
采药 (C++代码) 摘要:#include<bits/stdc++.h> using namespace std; typedef long long ll; const ll MAX=987654321; ll n,…… 题解列表 2018年11月13日 2 点赞 0 评论 370 浏览 评分:0.0
0/1背包问题,递归求解,动态规划 摘要:朴素递归算法(时间超限)参考代码:#include <stdio.h> int t,m; typedef struct Item { int time; int va…… 题解列表 2019年01月06日 0 点赞 0 评论 548 浏览 评分:0.0
采药 (C++代码)DP(动态规划) 摘要:解题思路: 标准的01背包问题。参考代码:#include<iostream> #include<cmath> #define hh ios::sync_with_stdio(false),…… 题解列表 2019年03月23日 0 点赞 0 评论 635 浏览 评分:0.0
采药 (C语言代码) 摘要:解题思路:使用结构体数组运算,创建一个价值除以时间的百分比量q,用这个q进行比较,排序,最后提取前几个时间加起来小于time就可以。注意事项:并不完善,成功率91%;因为有一些用double算不完全,…… 题解列表 2019年02月27日 0 点赞 0 评论 398 浏览 评分:0.0