HDU 6774 String Distance (序列自動機+dp)

題意:給出兩個字符串a(1e5)和b(20),再給出q個詢問區間l,r,求字符串a下標l到r的子串變爲b最少要幾回操做,每次操做限定爲插入或刪除一個字符。html 題解:序列自動機+dp 從一個字符串 a [ l , r ] a[l, r] a[l,r]變爲另外一個字符串 b b b,咱們能夠先求得兩串的 l c s lcs lcs,先刪去 a a a中不是 l c s lcs lcs的,共 r
相關文章
相關標籤/搜索