![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
趣学算法
一个野指针
这个作者很懒,什么都没留下…
展开
-
加勒比海——最优装载问题
用一维数组存储古董的重量:# include <iostream># include <algorithm>using namespace std;const int N = 100005;double w[N];int main()输入数据double c; int n; //载重量c和古董个数n cout << "请输入可装载的...原创 2019-03-14 21:23:35 · 116 阅读 · 0 评论 -
阿里巴巴与四十大盗——背包问题
# include <iostream># include <algorithm>using namespace std;const int M = 10000005;struct three{ double w; //每个宝物的重量 double v; //每个宝物的价值 double p; //性价比}s[M];bool cmp(three ...原创 2019-03-15 23:27:59 · 703 阅读 · 0 评论