摘要: 一、Description年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶... 阅读全文
posted @ 2013-07-30 20:00 InkGenius 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 一、Description有两堆石子,数量任意,可以不同。游戏开始由两个人轮流取石子。游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子;二是可以在两堆中同时取走相同数量的石子。最后把石子全部取完者为胜者。现在给出初始的两堆石子的数目,如果轮到你先取,假设双方都采取最好的策略,问... 阅读全文
posted @ 2013-07-28 15:19 InkGenius 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 一、DescriptionMost positive integers may be written as a sum of a sequence of at least two consecutive positive integers. For instance,6 = 1 + 2 + 39 =... 阅读全文
posted @ 2013-07-27 17:14 InkGenius 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 一、DescriptionThe digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that ... 阅读全文
posted @ 2013-07-27 17:03 InkGenius 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 一、DescriptionYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, yo... 阅读全文
posted @ 2013-07-25 23:21 InkGenius 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 一、Description(3302)Given a string s of length n, a subsequence of it, is defined as another strings' = su1su2...sum where 1 ≤u1 z[i][j-1] ?z[i-1][j]:... 阅读全文
posted @ 2013-07-25 22:45 InkGenius 阅读(191) 评论(0) 推荐(0) 编辑
摘要: LCS(Longest Common Subsequence),即最长公共子序列。一个序列,如果是两个或多个已知序列的子序列,且是所有子序列中最长的,则为最长公共子序列。原理: 事实上,最长公共子序列问题也有最优子结构性质。然后,用动态规划的方法找到状态转换方程。 记:Xi=﹤x1,⋯,xi... 阅读全文
posted @ 2013-07-25 22:40 InkGenius 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 一、DescriptionStockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation amongst the stoc... 阅读全文
posted @ 2013-07-25 18:06 InkGenius 阅读(186) 评论(0) 推荐(0) 编辑
摘要: Floyd-Warshall算法:是解决任意两点间的最短路径的一种算法,可以正确处理有向图或负权的最短路径问题,同时也被用于计算有向图的传递闭包。原理:Floyd-Warshall算法的原理是动态规划(DP)。设D_{i,j,k}为从i到j的只以(1..k)集合中的节点为中间节点的最短路径的长度。若... 阅读全文
posted @ 2013-07-25 17:46 InkGenius 阅读(376) 评论(0) 推荐(0) 编辑
摘要: Floyd-Warshall算法:是解决任意两点间的最短路径的一种算法,可以正确处理有向图或负权的最短路径问题,同时也被用于计算有向图的传递闭包。原理:Floyd-Warshall算法的原理是动态规划(DP)。设D_{i,j,k}为从i到j的只以(1..k)集合中的节点为中间节点的最短路径的长度。若... 阅读全文
posted @ 2013-07-25 17:46 InkGenius 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 一、DescriptionStandard web browsers contain features to move backward and forward among the pages recently visited. One way to implement these features... 阅读全文
posted @ 2013-07-24 11:00 InkGenius 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 一、DescriptionStandard web browsers contain features to move backward and forward among the pages recently visited. One way to implement these features... 阅读全文
posted @ 2013-07-24 11:00 InkGenius 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 一、DescriptionEvery time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is covered by w... 阅读全文
posted @ 2013-07-23 19:16 InkGenius 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 一、DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequen... 阅读全文
posted @ 2013-07-23 10:47 InkGenius 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 一、DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequen... 阅读全文
posted @ 2013-07-23 10:47 InkGenius 阅读(131) 评论(0) 推荐(0) 编辑