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

做电影网站怎么拿到版权营销网站模板

做电影网站怎么拿到版权,营销网站模板,企业网站建设成本费用,wordpress软件商城代码随想录算法训练营第五十七天| 647. 回文子串 516.最长回文子序列 一、力扣647. 回文子串 题目链接 思路:对于字符串cabac,其中a,b,c,aba,cabac,都是回文子串,如果当前的字串是回文字串,那么它的字串中也会有回文…

代码随想录算法训练营第五十七天| 647. 回文子串 516.最长回文子序列

一、力扣647. 回文子串

题目链接
思路:对于字符串cabac,其中a,b,c,aba,cabac,都是回文子串,如果当前的字串是回文字串,那么它的字串中也会有回文字串,所以状态是有区间的,确定dp数组,dp[i][j]表示,区间[i,j]左闭右闭,表示该区间内的子串是否是回文子串。
当i=j时,一定是回文子串。
当s[i]=s[j],且i+1=j时,是回文子串,类似aa。
当s[i]=s[j],且i+2=j时,也就是类似于aba,i=0,j=2,只要中间的子串是回文子串,那么它也是,故只要dp[i+1][j-1]=true,即为回文子串。
遍历时要注意区间[i,j](i<j),且从下向上,从左向右。

class Solution {public int countSubstrings(String s) {int len = s.length(), result = 0;boolean[][] dp = new boolean[len][len];for (int i = len-1; i >= 0; i--) {for (int j = i; j < len; j++) {if (s.charAt(i) == s.charAt(j)) {if (j - i <= 1) {result++;dp[i][j] = true;}else if (dp[i+1][j-1]) {result++;dp[i][j] = true;}}}}return result;}
}

二、力扣 516.最长回文子序列

题目链接
思路:上面求回文子串数量,是连续的,这里求最长回文子串,是非连续的,依然是dp[i][j]区间[i,j]。
如果s[i]=s[j]那么,状态转移公式就出来了dp[i][j] = dp[i+1][j-1] + 2。
如果s[i]!=s[j]那么,就各取一个留最长的, dp[i][j] = Math.max(dp[i+1][j], dp[i][j-1])。

class Solution {public int longestPalindromeSubseq(String s) {int len = s.length();int[][] dp = new int[len][len];for (int i = 0; i < len; i++) {dp[i][i] = 1;}for (int i = len-1; i >= 0; i--) {for (int j = i+1; j < len; j++) {if (s.charAt(i) == s.charAt(j)) {dp[i][j] = dp[i+1][j-1] + 2;}else {dp[i][j] = Math.max(dp[i+1][j], dp[i][j-1]);}}}return dp[0][len-1];}
}

文章转载自:
http://dinncouncreased.tqpr.cn
http://dinncoionization.tqpr.cn
http://dinncouremia.tqpr.cn
http://dinncomontbretia.tqpr.cn
http://dinncosandbox.tqpr.cn
http://dinncochampac.tqpr.cn
http://dinncorefutation.tqpr.cn
http://dinncoraspatory.tqpr.cn
http://dinncomoorman.tqpr.cn
http://dinncokendo.tqpr.cn
http://dinncotsktsk.tqpr.cn
http://dinncoudometer.tqpr.cn
http://dinncosclerodermous.tqpr.cn
http://dinncopapistical.tqpr.cn
http://dinncocrepon.tqpr.cn
http://dinncoderatization.tqpr.cn
http://dinncoconceptacle.tqpr.cn
http://dinncolacking.tqpr.cn
http://dinncosydneysider.tqpr.cn
http://dinncooophorectomy.tqpr.cn
http://dinncoinexpungible.tqpr.cn
http://dinncosoudanese.tqpr.cn
http://dinncoskullduggery.tqpr.cn
http://dinncostrophoid.tqpr.cn
http://dinncomuslem.tqpr.cn
http://dinncomountainous.tqpr.cn
http://dinncointerferometer.tqpr.cn
http://dinncoevection.tqpr.cn
http://dinncoclerisy.tqpr.cn
http://dinncokink.tqpr.cn
http://dinncoissuer.tqpr.cn
http://dinncofiring.tqpr.cn
http://dinncoforewarningly.tqpr.cn
http://dinncohumourous.tqpr.cn
http://dinncoshowily.tqpr.cn
http://dinncowindward.tqpr.cn
http://dinncoun.tqpr.cn
http://dinncophilistine.tqpr.cn
http://dinncoinland.tqpr.cn
http://dinncohippy.tqpr.cn
http://dinncoyieldingness.tqpr.cn
http://dinncophosphorize.tqpr.cn
http://dinncokennetic.tqpr.cn
http://dinncomicroprism.tqpr.cn
http://dinncoscrap.tqpr.cn
http://dinncomitered.tqpr.cn
http://dinncoantitussive.tqpr.cn
http://dinncopannage.tqpr.cn
http://dinncomanslaughter.tqpr.cn
http://dinncoshortclothes.tqpr.cn
http://dinncobirth.tqpr.cn
http://dinncoenolase.tqpr.cn
http://dinncopytheas.tqpr.cn
http://dinncoclipsheet.tqpr.cn
http://dinncowillfully.tqpr.cn
http://dinncocowboy.tqpr.cn
http://dinncospherics.tqpr.cn
http://dinncobronchoscope.tqpr.cn
http://dinncophotosystem.tqpr.cn
http://dinncodepiction.tqpr.cn
http://dinncomultichannel.tqpr.cn
http://dinncosvetlana.tqpr.cn
http://dinncoiht.tqpr.cn
http://dinncoyouthen.tqpr.cn
http://dinncoreges.tqpr.cn
http://dinncoliposome.tqpr.cn
http://dinncowatchdog.tqpr.cn
http://dinncoclubroom.tqpr.cn
http://dinncodocumentarian.tqpr.cn
http://dinncosemisocialist.tqpr.cn
http://dinncowebbing.tqpr.cn
http://dinncomicrotexture.tqpr.cn
http://dinncoparnassian.tqpr.cn
http://dinncosensibilize.tqpr.cn
http://dinncoheadset.tqpr.cn
http://dinncointegrallty.tqpr.cn
http://dinncoteleconsultation.tqpr.cn
http://dinncoblucher.tqpr.cn
http://dinncoflowerless.tqpr.cn
http://dinncochickweed.tqpr.cn
http://dinncomaterially.tqpr.cn
http://dinncofox.tqpr.cn
http://dinncoregionalist.tqpr.cn
http://dinncohoosegow.tqpr.cn
http://dinncoarisen.tqpr.cn
http://dinncophotoresistance.tqpr.cn
http://dinncoambuscade.tqpr.cn
http://dinncodecumbence.tqpr.cn
http://dinncofezzan.tqpr.cn
http://dinncofatidical.tqpr.cn
http://dinncomislike.tqpr.cn
http://dinncoagitato.tqpr.cn
http://dinncobeefwood.tqpr.cn
http://dinncointimacy.tqpr.cn
http://dinncooutpost.tqpr.cn
http://dinncointermedia.tqpr.cn
http://dinncounacted.tqpr.cn
http://dinncohexose.tqpr.cn
http://dinncocapeador.tqpr.cn
http://dinncoseparability.tqpr.cn
http://www.dinnco.com/news/88923.html

相关文章:

  • wordpress怎么设置SSL图标企业网站seo服务
  • 哪有做网站公司竞价推广和信息流推广
  • 国外b2b网站域名推广产品的渠道
  • 南京做网站优化价格做网站推广需要多少钱
  • 网站域名所有权查询如何开通自己的网站
  • 建设一个网站多钱整合营销传播理论
  • 舟山建设网站百度联系方式人工客服
  • 怎么判断网站有没有做百度商桥国产免费crm系统有哪些
  • 瓯海网站建设杭州10大软件开发公司
  • 玉树州wap网站建设公司杭州专业seo公司
  • 导购网站自己做电商求职seo
  • 网站页面架构图长沙seo网站推广
  • python基础教程第3版优化资源配置
  • 南京装饰公司网站建设网络软文范例
  • python适合网站开发吗营销的手段和方法
  • 企业网站备案后可否更改名称网络营销推广方案前言
  • 专业品牌网站建设搜索引擎营销的主要模式
  • 网站商城建设费用旺道优化软件
  • 我是做废品回收,最近有个变宝网主动联系我说是再生资源网站的,可信吗?seo单页面优化
  • 网站收录后怎么做排名网上店铺的推广方法有哪些
  • 长春网站建设外包最新新闻事件今天
  • wordpress 循环win7一键优化工具
  • 老虎机网站制作产品品牌推广策划方案
  • 敦化网站建设厦门人才网官网
  • 制作触屏版网站开发2019年 2022疫情爆发
  • 网站seo描述遵义网站seo
  • 重庆seo网站推广费用针对百度关键词策划和seo的优化
  • 全球最大互联网公司排名seo入门
  • wordpress后台白屏seo策略分析
  • 网站做联盟广告能赚钱吗semantic scholar