- 博客(8)
- 收藏
- 关注
原创 poj1088
poj1088题意:给出一个矩阵,求出一个点上下左右走按递减的最大长度。分析:思想差不多算是dfs,递归一块,如果要列可以列出dp方程,也算dp。大体的跟dfs递归算法一样,每个点有且仅有一次能被操作到,这可以用color[][]数组来解决。一旦找到上下左右比他小的,进行递归,并且长度加一。最后返回一个上下左右最大的一个数。 AC java代码如下:import java.util
2016-01-04 22:17:18
264
原创 Six Degrees of Cowvin Bacon(最短路径floyd算法)
DescriptionThe cows have been making movies lately, so they are ready to play a variant of the famous game "Six Degrees of Kevin Bacon".The game works like this: each cow is considered to be z
2014-08-01 15:00:07
349
原创 经典DP水题D
DescriptionMichael The Kid receives an interesting game set from his grandparent as his birthday gift. Inside the game set box, there are n tiling blocks and each block has a form as follows:
2014-07-26 11:17:50
386
转载 最长上升子序列LIS算法思路加模板
介绍一:LIS(Longest Increasing Subsequence)最长上升(不下降)子序列,有两种算法复杂度为O(n*logn)和O(n^2)。在上述算法中,若使用朴素的顺序查找在D1..Dlen查找,由于共有O(n)个元素需要计算,每次计算时的复杂度是O(n),则整个算法的时间复杂度为O(n^2),与原来算法相比没有任何进步。但是由于D的特点(2),在D中查找时,可以使用二分
2014-07-26 10:09:46
321
原创 经典DP水题C
DescriptionA military contractor for the Department of Defense has just completed a series of preliminary tests for a new defensive missile called the CATCHER which is capable of intercepting mu
2014-07-26 10:06:41
439
原创 经典DP水题G
DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence Z = is a subsequence of X if there exists
2014-07-25 16:51:16
552
原创 经典DP水题B
Description'Oh no, they've done it again', cries the chief designer at the Waferland chip factory. Once more the routing designers have screwed up completely, making the signals on the chip conn
2014-07-25 14:28:01
358
原创 经典DP水题A
A - 好Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionA numeric sequence of ai is ordered if a1 a2 aN. Let the subsequence of t
2014-07-25 13:58:00
326
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人