写代码是一种艺术,甚于蒙娜丽莎的微笑!

不拼搏,枉少年!

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2015年12月9日

摘要: 最长公共子序列也是动态规划中的一个经典问题。 有两个字符串 S1 和 S2,求一个最长公共子串,即求字符串 S3,它同时为 S1 和 S2 的子串,且要求它的长度最长,并确定这个长度。这个问题被我们称为最长公共子序列问题。 与求最长递增子序列一样,我们首先将原问题分割成一些子问题,我们用 dp[i] 阅读全文
posted @ 2015-12-09 22:12 RunningSnail 阅读(1088) 评论(0) 推荐(0)

摘要: 最长递增子序列是动态规划中经典的问题,详细如下: 在一个已知的序列{a1,a2,...,an}中,取出若干数组组成新的序列{ai1,ai2,...,aim},其中下标i1,i2,...,im保持递增,即新数列中的各个数之间依旧保持原数列中的先后顺序,那么我们称新的序列{ai1,ai2,...,aim 阅读全文
posted @ 2015-12-09 20:32 RunningSnail 阅读(3095) 评论(1) 推荐(0)

摘要: The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of 阅读全文
posted @ 2015-12-09 17:21 RunningSnail 阅读(406) 评论(0) 推荐(0)

摘要: A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacen 阅读全文
posted @ 2015-12-09 16:36 RunningSnail 阅读(387) 评论(0) 推荐(0)

摘要: Ignatius被魔王抓走了,有一天魔王出差去了,这可是Ignatius逃亡的好机会.魔王住在一个城堡里,城堡是一个A*B*C的立方体,可以被表示成A个B*C的矩阵,刚开始Ignatius被关在(0,0,0)的位置,离开城堡的门在(A-1,B-1,C-1)的位置,现在知道魔王将在T分钟后回到城堡,I 阅读全文
posted @ 2015-12-09 14:52 RunningSnail 阅读(232) 评论(0) 推荐(0)