摘要: #include<iostream>#include<string>using namespace std;#define MAX_CHILD 100class TreeNode{public: string myNum; int childCount; int level; string*chil 阅读全文
posted @ 2016-09-23 18:03 narcissuscyn 阅读(112) 评论(0) 推荐(0) 编辑
摘要: #include<string.h>#include<fstream>#include <iostream>#include<queue>using namespace std;const int MAXN=500;const int INF=0xfffff; struct City{public: 阅读全文
posted @ 2016-09-23 18:01 narcissuscyn 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 对于物体可分割的背包问题,要获得最大的利益,我们可以选择贪心方法;而对于不可分割的问题,我们将使用动态规划的方法来解决。 1.首先回忆一下动态规划的知识: 2.0/1背包问题(对于有n个物品,容量为M的背包,每个物品或者取或者不取,即xi取0或1;要使放入背包物体的效益和最大!) 极大化 ∑ pix 阅读全文
posted @ 2016-09-23 17:11 narcissuscyn 阅读(211) 评论(0) 推荐(0) 编辑