HDU2476 String painter(区间DP)

There are two strings A and B with equal length. Both strings are made up of lower case letters. Now you have a powerful string painter. With the help of the painter, you can change a segment of characters of a string to any other character you want. That is, after using the painter, the segment is made up of only one kind of character. Now your task is to change A to B using string painter. What’s the minimum number of operations?

InputInput contains multiple cases. Each case consists of two lines:
The first line contains string A.
The second line contains string B.
The length of both strings will not be greater than 100.
OutputA single line contains one integer representing the answer.Sample Input

zzzzzfzzzzz
abcdefedcba
abababababab
cdcdcdcdcdcd

Sample Output

6
7
自闭了...智商下线...
大意就是给两个字符串,每次操作能将第一个串的一个区间全部变成相同的字符,问最少经过多少次操作能将第一个串变成第二个串。
先占个坑,有朝一日搞懂了再来填
https://blog.csdn.net/Sirius_han/article/details/81323901
https://blog.csdn.net/sdjzping/article/details/19241603?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task
https://blog.csdn.net/a1046765624/article/details/80662802?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task
https://blog.csdn.net/mengxiang000000/article/details/73505936?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task
https://blog.csdn.net/weixin_43958964/article/details/104093726?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task


猜你喜欢

转载自www.cnblogs.com/lipoicyclic/p/12528889.html