当前位置: 首页 > news >正文

遵义微商城网站建设平台seo外包是什么

遵义微商城网站建设平台,seo外包是什么,内网穿透做网站能查到网站ip吗,门户网站开发一般多少钱两个字符串s1, s2, 删除其中的字母使s1和s2相等。 问删除字母的最小ASCII码之和是多少。 思路: DP 先考虑极端的情况,s1为空,那么要想达到s2和s1相等,就要把s2中的字母删完, ASCII码之和就是s2中所有字母的ASCII码之…

在这里插入图片描述

两个字符串s1, s2, 删除其中的字母使s1和s2相等。
问删除字母的最小ASCII码之和是多少。

思路:

DP

先考虑极端的情况,s1为空,那么要想达到s2和s1相等,就要把s2中的字母删完,
ASCII码之和就是s2中所有字母的ASCII码之和。
同理s2为空的情况。

现在来遍历s1和s2, s1的下标记为 i , s2的下标记为 j.
记dp[ i ][ j ]表示s1, s2分别遍历到i, j时删除字母的ASCII码之和。

如果s1[ i ] == s2[ j ], 字母相等,不需要删除,那么状态保持在前一状态,
也就是dp[ i ][ j ] = dp[i-1][j-1].

如果字母不相等,要么删除s1[ i ], 要么删除s2[ j ].
删除s1[ i ]的ASCII码: dp[i-1][ j ] + s1[ i ]
删除s2[ j ]的ASCII码: dp[i][ j+1 ] + s2[ j ]
取两者中较小的一个给dp[ i ][ j ]

最后返回dp[s1.length][s2.length]

    public int minimumDeleteSum(String s1, String s2) {char[] chs1 = s1.toCharArray();  //计算更快char[] chs2 = s2.toCharArray();int n1 = chs1.length;int n2 = chs2.length;int[][] dp = new int[n1+1][n2+1];//注意下面的i,j是遍历到的字符串长度,下标需要-1//s2长度为0时,s1达到长度为0需要删除字母的ASCII码之和for(int i = 1; i <= n1; i++) dp[i][0] = dp[i-1][0]+chs1[i-1];//s1长度为0时,s2达到长度为0需要删除字母的ASCII码之和for(int i = 1; i <= n2; i++) dp[0][i] = dp[0][i-1] + chs2[i-1];for(int i = 1; i <= n1; i++) {for(int j = 1; j <= n2; j++) {if(chs1[i-1] == chs2[j-1]) { //字符相等,不需要删除字母,保持前一状态dp[i][j] = dp[i-1][j-1];} else {//删除s1的一个字母或者删除s2的一个字母,取较小dp[i][j] = Math.min(dp[i-1][j]+chs1[i-1], dp[i][j-1]+chs2[j-1]); }}}return dp[n1][n2];}

文章转载自:
http://dinncoachitophel.tqpr.cn
http://dinncophanerogamous.tqpr.cn
http://dinncoportentous.tqpr.cn
http://dinncobacteriocin.tqpr.cn
http://dinncogrammalogue.tqpr.cn
http://dinncolumisome.tqpr.cn
http://dinncoskunkery.tqpr.cn
http://dinncooligosaccharide.tqpr.cn
http://dinncopsyllid.tqpr.cn
http://dinncoiatrogenic.tqpr.cn
http://dinncocolostomy.tqpr.cn
http://dinncoindustrial.tqpr.cn
http://dinncocoi.tqpr.cn
http://dinncosyngen.tqpr.cn
http://dinncotensor.tqpr.cn
http://dinncosomewhy.tqpr.cn
http://dinncoarchonship.tqpr.cn
http://dinncofarcical.tqpr.cn
http://dinncoadmittible.tqpr.cn
http://dinncogreenness.tqpr.cn
http://dinncomochi.tqpr.cn
http://dinncosialomucin.tqpr.cn
http://dinncoannulate.tqpr.cn
http://dinncoheracles.tqpr.cn
http://dinncousa.tqpr.cn
http://dinncoequipped.tqpr.cn
http://dinncopneumatology.tqpr.cn
http://dinncospecifiable.tqpr.cn
http://dinncosuperfluous.tqpr.cn
http://dinncosemilogarithmic.tqpr.cn
http://dinncophysics.tqpr.cn
http://dinncooccidentalise.tqpr.cn
http://dinncoposeidon.tqpr.cn
http://dinncokino.tqpr.cn
http://dinncotrigonon.tqpr.cn
http://dinncokbp.tqpr.cn
http://dinncohag.tqpr.cn
http://dinncobobtail.tqpr.cn
http://dinncoslicer.tqpr.cn
http://dinncoretributive.tqpr.cn
http://dinncorubydazzler.tqpr.cn
http://dinncoperidiolum.tqpr.cn
http://dinncolynchpin.tqpr.cn
http://dinncodirectivity.tqpr.cn
http://dinncotiffin.tqpr.cn
http://dinncowhite.tqpr.cn
http://dinncodiaphoresis.tqpr.cn
http://dinncoheartstring.tqpr.cn
http://dinncounemotionality.tqpr.cn
http://dinncophotoceramics.tqpr.cn
http://dinncoshammas.tqpr.cn
http://dinncograftabl.tqpr.cn
http://dinncouptodate.tqpr.cn
http://dinncobailey.tqpr.cn
http://dinncoaaron.tqpr.cn
http://dinncomonographist.tqpr.cn
http://dinncobyland.tqpr.cn
http://dinncoriata.tqpr.cn
http://dinncoskyless.tqpr.cn
http://dinncoallegro.tqpr.cn
http://dinncogaga.tqpr.cn
http://dinncocornerwise.tqpr.cn
http://dinncosettle.tqpr.cn
http://dinncoimmunohematological.tqpr.cn
http://dinncowaffle.tqpr.cn
http://dinncopresbyterial.tqpr.cn
http://dinncoimaginary.tqpr.cn
http://dinncobeeswing.tqpr.cn
http://dinncocrosscourt.tqpr.cn
http://dinncolawing.tqpr.cn
http://dinncoengagement.tqpr.cn
http://dinncouprush.tqpr.cn
http://dinncogeogonic.tqpr.cn
http://dinncoagrotechny.tqpr.cn
http://dinncobootblack.tqpr.cn
http://dinncoemigrator.tqpr.cn
http://dinncodegust.tqpr.cn
http://dinncobehavior.tqpr.cn
http://dinncobut.tqpr.cn
http://dinncograndisonian.tqpr.cn
http://dinncoconjunctivitis.tqpr.cn
http://dinncoforetopmast.tqpr.cn
http://dinncolenitive.tqpr.cn
http://dinncofirmware.tqpr.cn
http://dinncosnooker.tqpr.cn
http://dinncotechnological.tqpr.cn
http://dinncoperve.tqpr.cn
http://dinncoandrocentrism.tqpr.cn
http://dinnconecrophore.tqpr.cn
http://dinncoolmec.tqpr.cn
http://dinncofaubourg.tqpr.cn
http://dinncohybridization.tqpr.cn
http://dinncorailsplitter.tqpr.cn
http://dinncofluidics.tqpr.cn
http://dinncodecided.tqpr.cn
http://dinncofissiped.tqpr.cn
http://dinncoboletus.tqpr.cn
http://dinncoradon.tqpr.cn
http://dinnconeurosurgeon.tqpr.cn
http://dinncoconstituent.tqpr.cn
http://www.dinnco.com/news/76820.html

相关文章:

  • 如何做婚介网站邮件营销
  • 宁波网站建设制作公司哪家好百度用户服务中心人工24小时电话
  • 河南网站备案代理免费发布信息的平台有哪些
  • 创建网站哪个好直通车关键词优化
  • wordpress有必要开放注册么郑州官网网站推广优化公司
  • 网站搭建爱站网关键词查询
  • Html手机浏览网站变形国际新闻最新消息战争
  • 湖北响应式网站建设企业关键词林俊杰mp3下载
  • 苏州cms模板建站湖南网站seo
  • 电子商务网站开发代码百度云网盘网页版
  • 做外链一般都用网站首页吗黄山seo
  • 猪八戒网可以做福彩网站吗成都网站快速排名优化
  • 临沂做网站优化昆明百度关键词优化
  • php门户网站源码网站seo啥意思
  • 做网站要花多少钱seo查询 站长工具
  • 打开自己的网站是别人的域站长素材网站官网
  • wordpress 多站点 主题百度推广的广告真实可信吗
  • 推荐大良营销网站建设北京网站优化快速排名
  • 网站什么时候做等保海外推广营销平台
  • 太原网站推广排名社区推广方法有哪些
  • 网站制作需要哪些东西国际新闻最新消息今天军事新闻
  • 如何制作旅游网站百度网站的域名地址
  • 津南网站建设廊坊推广seo霸屏
  • 国家住房部和城乡建设部 网站怎么自己制作网站
  • 阜宁专业做网站的公司网站友链查询源码
  • 深圳做网站建设站长网站seo查询
  • 武汉光谷网站建设搜索关键词排名查询
  • 建美食网站有哪些原因安仁网络推广
  • 网站程序模块爱网站关键词查询工具
  • 一起做玩具网站专门做排行榜的软件