【动态规划】【二分】Petrozavodsk Winter Training Camp 2017 Day 1: Jagiellonian U Contest, Monday, January 30, 2017 Problem B. Dissertation

题意:

给定S1串,长度100w,S2串,长度1k。问它俩的LCS。

 

f(i,j)表示S2串前i个字符,LCS为j时,最少需要的S1串的前缀长度。转移的时候,枚举下一个字符在S1的位置即可。(可以预处理出S1中每个字符出现位置的vector,在其中二分)

posted @ 2017-07-09 21:56  AutSky_JadeK  阅读(285)  评论(0)    收藏  举报
TVアニメ「Charlotte(シャーロット)」公式サイト TVアニメ「Charlotte(シャーロット)」公式サイト