01 2013 档案

Edit Distance
摘要:Edit DistanceTime Limit:1000MSMemory Limit:65535KBSubmissions:1320Accepted:268Description设A 和B 是2 个字符串。要用最少的字符操作将字符串A 转换为字符串B。这里所说的字符操作包括 (1)删除一个字符; (2)插入一个字符; (3)将一个字符改为另一个字符。 将字符串A变换为字符串B 所用的最少字符操作数称为字符串A到B 的编辑距离,记为d(A,B)。试设计一个有效算法,对任给的2 个字符串A和B,计算出它们的编辑距离d(A,B)。Input第一行是字符串A,文件的第二行是字符串B。字符串长度不大于2 阅读全文

posted @ 2013-01-30 18:24 即为将军 阅读(176) 评论(0) 推荐(0)

Stone Game
摘要:Stone GameTime Limit:1000MSMemory Limit:65535KBSubmissions:1Accepted:1DescriptionAC and WA love to collect stones and play games with them. Up till now they have collected Na white stones and Nb black stones, and they are going to play a new game. The rules of the game is as follows: (1) All the sto 阅读全文

posted @ 2013-01-30 15:21 即为将军 阅读(365) 评论(0) 推荐(0)

导航