题意:给你一个序列,问你删除掉连续的一段,使得剩下的序列的最长上升字串最大,问你这个最大值。解题思路:分段dp, dp[i][0] ,dp[i][1] , 0表示前面没有切过,只能从前一个数的0状态得到,1状态表示前面已经切过了,能从前一个的1状态得到,也能从 在他前面的比他值小的dp[j][0]....
分类:
其他好文 时间:
2015-03-29 09:24:58
阅读次数:
128
1551: Longest Increasing Subsequence Again
Time Limit: 2 Sec Memory Limit: 256 MB
Submit: 29 Solved: 15
[Submit][Status][Web
Board]
Description
Give you a numeric sequence. If you can d...
分类:
其他好文 时间:
2015-03-28 23:18:21
阅读次数:
432
Emuskald is an avid horticulturist and owns the world’s longest greenhouse — it is effectively infinite in length.Over the years Emuskald has cultivated n plants in his greenhouse, of m different plant...
分类:
其他好文 时间:
2015-03-28 14:24:52
阅读次数:
135
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without
repeating letters for "abcabcbb" is "abc", which the length is 3. Fo...
分类:
其他好文 时间:
2015-03-22 10:40:52
阅读次数:
321
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:
其他好文 时间:
2015-03-22 00:18:36
阅读次数:
134
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:
其他好文 时间:
2015-03-21 21:12:41
阅读次数:
150
uva 10285 Longest Run on a Snowboard题目大意:给出一张n*m的雪地地图,每格标注的是该点的高度。从地势高的地方可以滑到地势低的地方(只能上下左右滑),问最长的滑雪距离。解题思路:逐一访问各点,若该点没有被访问过,则进行DFS找出该点为滑雪起始点的最长滑雪距离,用dp数组记录,若该点已被访问过,则返回其对应的dp数组记录的值。#include
#i...
分类:
其他好文 时间:
2015-03-21 20:02:53
阅读次数:
158
题目:
Write a function to find the longest common prefix string amongst an array of strings.
即求给定的一组字符串的公共前缀。思路分析:
一个一个寻找前缀,先比较第一个和第二个,找到公共前缀,然后公共前缀和第三个比较,寻找公共前缀,以此类推。C++参考代码:class Solution
{
public:...
分类:
其他好文 时间:
2015-03-21 20:01:49
阅读次数:
173
Longest Substring Without Repeating Characters </htm
分类:
Web程序 时间:
2015-03-21 18:29:41
阅读次数:
147
Classic DP, and requires you to track optimal path.len1, len2 = map(int, raw_input().strip().split())a = map(int, raw_input().strip().split())b = map(...
分类:
其他好文 时间:
2015-03-21 15:26:57
阅读次数:
199