zoukankan      html  css  js  c++  java
  • pku3356AGTC(做的最少修改动作,动态规划)

    4228K 0MS GCC 568B 2009-01-09 11:00:31

    注意:这道题目是多case。。。。害我在这上面wrong了n次。

    数组best[i][j],第一个字符串前i位和第二个字符串前j位能做到的最优值。

    分析:

    1)a[i]==b[j],best[i][j]=best[i-1][j-1];

    2)  a[i]!=b[j],best[i][j]=min(best[i-1][j-1],best[i-1][j],best[i][j-1])+1;

    第一个元素:修改操作。第二个元素:删除操作。第三个元素:添加操作。

    代码如下:

     

    Code
  • 相关阅读:
    HBase权威指南
    Mapreduce编程
    Hive内部表和外部表的区别
    Android Volley全然解析(四),带你从源代码的角度理解Volley
    codeforces 448CPainting Fence
    2.maven 安装配置
    cocos2d-x 3.0正式版创建project笔记
    C. DZY Loves Sequences
    spring 基础回想 tips01
    spring 配置属性细节
  • 原文地址:https://www.cnblogs.com/pandy/p/1372406.html
Copyright © 2011-2022 走看看