摘要: 拓扑排序是对ADG(有向无环图进行线性排序)模板:二维数组模拟链表#include#include#include#includeusing namespace std;int indegree[100];queue q;int n,m;bool map[100][100];int a[100];i... 阅读全文
posted @ 2015-05-01 20:26 Painting、时光 阅读(242) 评论(0) 推荐(0) 编辑
摘要: DescriptionJohn never knew he had a grand-uncle, until he received the notary's letter. He learned that his late grand-uncle had gathered a lot of mon... 阅读全文
posted @ 2015-05-01 16:33 Painting、时光 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 找钱问题描述:与背包问题不同,找钱问题是结果必须是把容量全部装满一.用的钱的最大最小数目把空间开大,所需求的dp值只是其中的一种特殊情况而已1.01背包模型,每种货币只能用一次最小求法#include#include#includeusing namespace std;int dp[50000],... 阅读全文
posted @ 2015-05-01 16:06 Painting、时光 阅读(341) 评论(0) 推荐(0) 编辑
摘要: DescriptionFarmer John has gone to town to buy some farm supplies. Being a very efficient man, he always pays for his goods in such a way that the sma... 阅读全文
posted @ 2015-05-01 14:41 Painting、时光 阅读(178) 评论(0) 推荐(0) 编辑