B. 最长公共子序列 1

    Type: Default 1000ms 512MiB

最长公共子序列 1

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

时间限制: 1.0 秒

空间限制: 512 MB

题目描述

给定两个字符串,求其最长公共子序列的长度。

输入格式

从标准输入读入数据。

输入一共两行,每行一个字符串。

每个字符串仅包含小写字母,且长度不超过 10410^4

输出格式

输出到标准输出。

一个整数,为最长公共子序列的长度。

lucphiqzbwjekwwkmrephfuxfflkgbmzsfqtxqgjpfenynspwd
czvoxrmtvmxuwdgtaxtzgtaarupckyyyjqpmgxv
11

提示

chap 01 绪论,动态规划:记忆法,最长公共子序列。

如何才能避免代码实现为指数级呢?