# 杰拉斯的博客

```1
Ab3bd
```

```2
```

(阅读全文…)

## [ACM_ZOJ_1733]Longest Common Subsequence

### Common Subsequence （最长公共子序列）

Time Limit: 2 Seconds Memory Limit: 65536 KB

#### 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 X if there exists a strictly increasing sequence of indices of X such that for all j = 1,2,...,k, xij = zj. For example, Z = is a subsequence of X = with index sequence . Given two sequences X and Y the problem is to find the length of the maximum-length common subsequence of X and Y.

The program input is from a text file. Each data set in the file contains two strings representing the given sequences. The sequences are separated by any number of white spaces. The input data are correct. For each set of data the program prints on the standard output the length of the maximum-length common subsequence from the beginning of a separate line.

(阅读全文…)

## [ACM_POJ_2533]Longest Ordered Subsequence

### Longest Ordered Subsequence （最长有序子序列）

Time Limit: 2000MS Memory Limit: 65536K
Total Submissions: 21942 Accepted: 9441

#### Description

A numeric sequence of ai is ordered if a1 < a2 < ... < aN. Let the subsequence of the given numeric sequence (a1, a2, ..., aN) be any sequence (ai1, ai2, ..., aiK), where 1

Your program, when given the numeric sequence, must find the length of its longest ordered subsequence.

#### Input

The first line of input file contains the length of sequence N. The second line contains the elements of sequence - N integers in the range from 0 to 10000 each, separated by spaces. 1 <= N <= 1000

#### Output

Output file must contain a single integer - the length of the longest ordered subsequence of the given sequence.

(阅读全文…)

## [ACM_ZJUT_1029]斐波那契数列

### Fibonacci数

Time Limit:1000MS Memory Limit:32768K

```5
6
7
8
9
40
```

```5
8
13
21
34
102334155
```

(阅读全文…)

## [ACM_POJ_2081]动态规划入门练习（三）Recaman's Sequence

### Recaman's Sequence

Time Limit: 3000MS Memory Limit: 60000K
Total Submissions: 17939 Accepted: 7450

#### Description

The Recaman's sequence is defined by a0 = 0 ; for m > 0, am = am−1 − m if the rsulting am is positive and not already in the sequence, otherwise am = am−1 + m.
The first few numbers in the Recaman's Sequence is 0, 1, 3, 6, 2, 7, 13, 20, 12, 21, 11, 22, 10, 23, 9 ...