[UVa 10635]Prince and Princess

danihao123 posted @ 2016年9月15日 19:52 in 题解 with tags 动态规划 UVa 序列DP , 784 阅读
转载请注明出处:http://danihao123.is-programmer.com/

这个名字真有童话风味哎……

直接LCS肯定会TLE。注意每个序列都是不重复序列,所以可以将A映射到,然后再把B映射一下(有的可能A里面没有?反正既然A里没有就和LCS没关系了),就相当于求B的LIS。LIS可以在时间内完成。

代码:


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter