C. 编辑距离

    Type: Default 1000ms 256MiB

编辑距离

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

算法系列之动态规划3

Not Claimed
Status
Done
Problem
5
Open Since
2026-1-18 0:00
Deadline
2026-1-25 23:59
Extension
24 hour(s)