Type: Default 1000ms 256MiB

【例9.20】编辑距离

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.

【题目描述】

设A和B是两个字符串。我们要用最少的字符操作次数,将字符串A转换为字符串B。这里所说的字符操作共有三种:

1、删除一个字符;

2、插入一个字符;

3、将一个字符改为另一个字符。

对任意的两个字符串A和B,计算出将字符串A变换为字符串B所用的最少字符操作次数。

【输入】

第一行为字符串A;第二行为字符串B;字符串A和B的长度均小于2000。

【输出】

只有一个正整数,为最少字符操作次数。

【输入样例】

sfdqxbw
gfdgw

【输出样例】

4

【来源】

一本通在线评测

B班基础dp巩固训练:序列问题

Not Claimed
Status
Done
Problem
14
Open Since
2024-8-9 14:45
Deadline
2024-8-26 23:59
Extension
24 hour(s)