【例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
【来源】
一本通在线评测
C23暑假作业6-线性DP-基础题
- Status
- Done
- Problem
- 11
- Open Since
- 2024-7-5 0:00
- Deadline
- 2024-10-27 23:59
- Extension
- 24 hour(s)