题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=4991
Ordered Subsequence
Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 221 Accepted Su...
分类:
其他好文 时间:
2014-09-10 15:56:40
阅读次数:
145
问题描述:序列X={x1,x2,…,xn},Y={y1,y2,…,yn},当Z={z1,z2…,zn}是X的严格递增下标顺序(可以不连续)的子集,也是Y的严格递增下标顺序(可以不连续)的子集,则Z是X和Y的公共子序列。例如X={A,B,C,B,D,A,B},Y={B,D,C,A,B,A},{B,C,A}、{B,C,B,A}、{B,D,A,B}都是X和Y的公共子序列。其中最长的公共子序列叫做Long...
分类:
其他好文 时间:
2014-09-10 15:53:20
阅读次数:
317
题目链接:hdu 4991 Ordered Subsequence
题目大意:给定一个序列,求有多少个子序列满足长度为m,并且递增。
解题思路:dp[i][j]表示说选了以第i个数为结尾,长度为j的递增子串方案数。将每个数离散化后用树状数组维护即可。
#include
#include
#include
#include
#define lowbit(x) ((x)&(-x...
分类:
其他好文 时间:
2014-09-10 12:37:10
阅读次数:
235
It's still an Amazon interview question. Given an array containing only stars '*' and hashes '#' . Find longest contiguous sub array that will cont...
分类:
其他好文 时间:
2014-09-09 21:20:49
阅读次数:
254
Longest Valid Parentheses
Total Accepted: 14818 Total
Submissions: 75749My Submissions
Given a string containing just the characters '(' and ')',
find the length of the longest valid (w...
分类:
其他好文 时间:
2014-09-09 13:18:18
阅读次数:
166
Longest Common Prefix
Total Accepted: 17298 Total
Submissions: 63704My Submissions
Write a function to find the longest common prefix string amongst an array of strings.
题意...
分类:
其他好文 时间:
2014-09-09 13:16:38
阅读次数:
135
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longes...
分类:
其他好文 时间:
2014-09-09 12:14:08
阅读次数:
200
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:
其他好文 时间:
2014-09-09 11:49:38
阅读次数:
167
Ordered SubsequenceTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 114Accepted Submission(s): 58Pr...
分类:
其他好文 时间:
2014-09-09 11:23:48
阅读次数:
206