题目大意是给定两个字符串,要求通过插入、删除、替换这三种操作来将第一个字符串转化为第二个字符串,问最少需要的操作次数以及具体的操作方案。
模型很明显是最长公共子串,同样是分两种两种情况考虑,s1[i]=s2[j]时,f[i,j]=min(f[i-1,j-1],f[i-1,j]+1,f[i,j-1]+1),分别对应第一个字符串的第i个字符与第二个字符串的第j个字符匹配、删除第一个字符串的第i个字符、在第一个字符串的第i+1位插入第二个字符串的第j位字符;s1[i]<>s2[j]时,f[i,j]=min(f[i-1,j-1]+1,f[i-1,j]+1,f[i,j-1]+1),分别对应第一个字符串的第i个字符替换为第二个字符串的第j个字符、删除第一个字符串的第i个字符、在第一个字符串的第i+1位插入第二个字符串的第j位字符。f[i,j]则表示第一个字符串的前i个字符转化为第二个字符串前j个字符所需的最少操作次数。在DP过程中记录下每次状态转移对应的具体的操作,则可以通过倒推输出所有操作步骤。
3069395 2008-09-14 13:41:20 Accepted 1459 FPC 00:00.06 420K IwfWcf
qihang0922,kevin durant shoes
回复删除chaussure louboutin
hollister
ed hardy clothing
basketball shoes
longchamp outlet
longchamp
nike free run
swarov ski jewelry
nike air max
mcm handbags
toms outlet
nike sb
uggs boots on sale
ray ban sunglasses
nike free runs
polo outlet
nike huarache
nike air max 90
tods outlet
abercrombie and fitch
supra shoes
instyler curling iron
nike cortez
christian louboutin shoes
mcm outlet
louis vuitton borse
kate spade uk
gucci outlet
canada goose outlet
instyler max
tory burch outlet
ralph lauren outlet
gucci borse
jordan pas cher
ugg boots
longchamp handbags
air max
q
zhengjx20160520
回复删除vans sneakers
kobe shoes
ray ban sunglasses uk
louis vuitton purses
ghd hair straighteners
toms wedges
ralph lauren outlet
coach outlet
coach factory outlet online
longchamp le pliage
ray ban outlet
michael kors outlet clearance
nike air max uk
oakley vault
tory burch boots
christian louboutin sale clearance
abercrombie outlet
coach outlet
louis vuitton outlet online
adidas originals store
gucci handbags
nhl jerseys
supra for sale
air max
coach factory outlet online
cheap air jordans
louis vuitton outlet
juicy couture
jordan retro 13
hollister clothing
christian louboutin shoes
oakley sunglasses
louis vuitton purses
adidas uk
gucci bags
michael kors outlet
asics running shoes
adidas running shoes
hollister clothing
coach outlet online
kate spade handbags
回复删除louis vuitton bags
pandora uk
moncler coats
supra shoes
ugg outlet
michael kors outlet online
adidas nmd runner
adidas yeezy
coach outlet online
201612.26chenjinyan
nike air max
回复删除ugg outlet
dolce and gabbana outlet
nike air max 90
coach factory outlet
canada goose sale
tiffany and co
burberry outlet store
hollister clothing
polo outlet
20170112caiyan
Impressive article dude! Many thanks
回复删除http://www.kuwait.prokr.net/
http://www.emirates.prokr.net/
rolex replica watches
回复删除ralph lauren uk
houston texans jerseys
ugg boots
oakley sunglasses
ugg boots
new balance shoes
hugo boss sale
oakley sunglasses
polo ralph lauren
nike air max
回复删除ferragamo belt
air jordan
air jordan
supreme outlet
fila shoes
christian louboutin outlet
yeezys
balenciaga shoes
hermes birkin
u6v67v6q96 g4w76v5a80 u8t53d0b00 q4q89o3q20 l7j61f4z37 l8y35o7q41
回复删除w3l55r0h67 m0c88p7e25 r6g69k6a68 f0q96k0t82 l2p83n1k40 s3t47t6n44
回复删除