题解 1100: 采药

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

筛选

采药 (C++代码)

摘要:解题思路: 逐渐求最大值(模板题,-多阶段决策问题)注意事项:遍历是从最大值数组中的1到你拥有的时间t参考代码:#include <cstdio>#include <algorithm>using n……

采药 (C语言代码)

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int x[1010];int main(){ int T,M,i,j; for(i=0;i<1000;i++){ x[i] = 0;……

采药 (C语言代码)

摘要:解题思路:用的是暴力求解,从给出的药草种类n中选1个,选2个,...  ,选n个,满足时间不超限制的,来计算药草价值,更新并在最后输出。上述方法时间用的较长,如果用优化算法,用最大流思想,仅供参考思想……

采药 (C++代码)

摘要://使用滚动数组 #include<cstdio> #include<algorithm> #include<iostream> using namespace std; int dp[10……

采药 (C语言代码)

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int a[1001];int main(){ int t,m; int i,j,k,l; int sj[101],jz[101]; s……

采药 (C语言代码)

摘要:解题思路:这道题提交了好多次都失败了,刚开始想当然地用贪心算法,后来发现错了又用回溯法,但是运行超时,最后采用动态规划顺利解决。这题的解题思路及方法其他题解已经讲得很清楚了。所以此文章仅仅是为了记下自……

采药 (C++代码)

摘要:解题思路:01背包注意事项:参考代码:#include<iostream> #include<algorithm> using namespace std; const int N_max=10……

采药 (C语言代码)

摘要:解题思路:01背包算法:最优解注意事项:参考代码:#include<stdio.h> int S[101][1001]; int Mvalue[101]; int Mtime[101]; in……

采药 (C语言代码)

摘要:解题思路:01背包+动态规划  思想可以网上找注意事项:参考代码:#include <stdio.h>int max(int a,int b);int main(){ int T,M,i,j; int……