http://poj.org/problem?id=1458Common SubsequenceTime Limit:1000MSMemory Limit:10000KTotal Submissions:43077Accepted:17439DescriptionA subsequence of a...
分类:
其他好文 时间:
2015-08-08 09:05:41
阅读次数:
91
【104-Maximum Depth of Binary Tree(二叉树的最大深度)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from th...
分类:
编程语言 时间:
2015-08-08 07:59:24
阅读次数:
126
题目传送门 1 /* 2 LPS(Longest Palidromic Subsequence):最长回文子序列,和回文串不同,子序列是可以不连续的。 3 转化为LCS问题,将字符串逆序,然后和本串求LCS就是LPS的长度(为啥不就是LPS?),但是前一半是LPS的一半,可以...
分类:
其他好文 时间:
2015-08-07 18:53:21
阅读次数:
190
不知道为啥,这样的题目跑到贪心里面去了,动态规矩挺简单,最后之前看了一遍他的问题,所以很容易就敲出来了,贪心暂时告一段落,开始dp,加油
思路:
最大子矩阵和的问题可以通过最大字段和的问题解出来,普通的暴力枚举是枚举行和列,时间复杂度为m^2*n^2,但是我们可以在行的上界和下界确定的情况下将这个矩阵压缩为一个一维数组存起来,然后利用最大字段和的求解解出来,代码应该很容易就能看懂,如果对动...
分类:
其他好文 时间:
2015-08-07 14:46:09
阅读次数:
168
#include#include#include#include#include#define INF 30000000#define pai 3.1415926using namespace std;char s1[1000],s2[1000];int dp[1000][1000];int mai...
分类:
其他好文 时间:
2015-08-06 22:09:09
阅读次数:
113
root@kali:~#?firefox?
Maximum?number?of?clients?reachedMaximum?number?of?clients?reachedError:?cannot?open?display:?:0.0 如上firefox起不来,报错“Maximum number of clients reachedMaxi...
分类:
系统相关 时间:
2015-08-05 16:35:22
阅读次数:
417
题目:Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest...
分类:
其他好文 时间:
2015-08-05 07:44:48
阅读次数:
139
问题:Given an array of N integer, find the length of the longest increasing subsequence.For example, given [1,-5,4,5,10,-1,-5,7], the longest increasing...
分类:
编程语言 时间:
2015-08-05 00:40:24
阅读次数:
154
Problem Difinition:Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the arr...
分类:
其他好文 时间:
2015-08-05 00:39:34
阅读次数:
144
A relatively difficult tree problem. Well, a recursive solution still gives clean codes. The tricky part of this problem is how to record the result. ...
分类:
其他好文 时间:
2015-08-04 22:41:28
阅读次数:
92