N - Longest Ordered Subsequence
Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u
Submit Status Practice POJ 2533
Description
A numeric sequence of ai is ordered if a1 < a2 < ...
分类:
其他好文 时间:
2015-05-02 11:14:23
阅读次数:
125
12. binary search Trees The search tree data structure supports many dynamic-set operations,including search ,minimum,maximum,predecessor,successor ,i...
分类:
其他好文 时间:
2015-05-01 23:45:21
阅读次数:
263
分析:最大团的模版题,DFS深搜。
#include
using namespace std;
#define N 55
int map[N][N];
int set[N];
int max;
bool IsConnect(int end,int v)
{
int i;
for(i=0;i<end;i++)
if(!map[set[i]][v])
return false;
...
分类:
其他好文 时间:
2015-05-01 13:27:54
阅读次数:
157
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 leaf node.
题意:求树的高度。
思路:就是递归。
/**
* Definiti...
分类:
其他好文 时间:
2015-05-01 12:06:48
阅读次数:
163
Common Subsequence
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 26493 Accepted Submission(s): 11771
Problem Description
A subsequ...
分类:
其他好文 时间:
2015-04-30 18:16:00
阅读次数:
105
问题:最长公共子序列就是寻找两个给定序列的子序列,该子序列在两个序列中以相同的顺序出现,但是不必要是连续的。例如序列X=ABCBDAB,Y=BDCABA。序列BCA是X和Y的一个公共子序列,但是不是X和Y的最长公共子序列,子序列BCBA是X和Y的一个LCS,序列BDAB也是。思路:1、最简单的方法就...
分类:
其他好文 时间:
2015-04-30 17:54:16
阅读次数:
103
参照:v_JULY_v
最长公共子序列定义:
注意最长公共子串(Longest CommonSubstring)和最长公共子序列(LongestCommon Subsequence, LCS)的区别:子串(Substring)是串的一个连续的部分,子序列(Subsequence)则是从不改变序列的顺序,而从序列中去掉任意的元素而获得的新序列;更简略地说,前者(子串...
分类:
其他好文 时间:
2015-04-30 14:23:18
阅读次数:
146
点击打开杭电1159
Problem Description
A 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 ...
分类:
其他好文 时间:
2015-04-30 14:20:31
阅读次数:
120
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-04-30 06:19:30
阅读次数:
117
UVa11404Palindromic Subsequence(最大回文串,区间DP)
Description
A Subsequence is a sequence obtained by deleting zero or more characters in a string. A Palindrome is a string which when read from left t...
分类:
其他好文 时间:
2015-04-29 17:23:29
阅读次数:
139