zoukankan      html  css  js  c++  java
  • 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


  • 相关阅读:
    Android之绚丽的图片游览效果--有点像W7效果,透明的倒影,层叠的图片,渐变的颜色透明度
    小程序自定义弹出框
    从零学React Native之04自定义对话框
    ajax的content-download时间过慢问题的解决与思考
    小程序
    使用自定义视图的AlertDialog
    Android浮动按钮
    android 实现微信分享多张图片的功能
    AndroidUI多线程网络请求更新导致BUG
    ==比较时的坑
  • 原文地址:https://www.cnblogs.com/lipoicyclic/p/12528889.html
Copyright © 2011-2022 走看看