题目:
思考:
(1)初始化:
s[0,0]=0
s[i,0] = i * cost(delete)
s[0,j] = j * cost[insert]
(2)递推
(3)最后的操作kill
c[i][j] = MIN(c[m,n], MIN(c[i,n]+cost(kill))), 其中0<=i<m
代码:
#include <iostream>
using namespace std;
//6种操作的代价,依次是copy,replace,delete,insert,twiddle,kill
int c