HDU2476 String painter (section 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 
autistic IQ off the assembly line ... the ...
the effect is to give two strings, one at a time interval of a string of operations can all become the same character, ask how many operations can at least after the first string into a second string.
Preemption pit, they get to know one day come back to fill
https://blog.csdn.net/Sirius_han/article/details/81323901
https://blog.csdn.net/sdjzping/article/details/19241603?depth_1-utm_source=distribute Task-utm_source = & .pc_relevant.none 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


Guess you like

Origin www.cnblogs.com/lipoicyclic/p/12528889.html