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

做logo有哪些网站新手怎样做网络推广

做logo有哪些网站,新手怎样做网络推广,做网站许昌,网页游戏赚钱吗力扣爆刷第100天之hot100五连刷86-90 文章目录 力扣爆刷第100天之hot100五连刷86-90一、139. 单词拆分二、300. 最长递增子序列三、152. 乘积最大子数组四、416. 分割等和子集五、32. 最长有效括号 一、139. 单词拆分 题目链接:https://leetcode.cn/problems/word-…

力扣爆刷第100天之hot100五连刷86-90

文章目录

      • 力扣爆刷第100天之hot100五连刷86-90
      • 一、139. 单词拆分
      • 二、300. 最长递增子序列
      • 三、152. 乘积最大子数组
      • 四、416. 分割等和子集
      • 五、32. 最长有效括号

一、139. 单词拆分

题目链接:https://leetcode.cn/problems/word-break/description/?envType=study-plan-v2&envId=top-100-liked
思路:定义dp[i]表示字符串s[0, i]可以被拼接出,那么如果要推导出当前s[0,i]可以被拼出,只需要,s[0, i-word.length]可以被拼出,且s[i-word.length] == w,即可推出,此即为递推公式。

class Solution {public boolean wordBreak(String s, List<String> wordDict) {boolean[] dp = new boolean[s.length() + 1];dp[0] = true;for(int i = 1; i < dp.length; i++) {for(String word : wordDict) {if(i < word.length() || dp[i] || !dp[i-word.length()]) continue;dp[i] = isTrue(s, word, i);}}return dp[s.length()];}boolean isTrue(String s, String word, int index) {int i = index - word.length(), j = 0;while(i < index) {if(s.charAt(i) != word.charAt(j)) return false;i++;j++;}return true;}
}

二、300. 最长递增子序列

题目链接:https://leetcode.cn/problems/longest-increasing-subsequence/description/?envType=study-plan-v2&envId=top-100-liked
思路:定义dp[i]表示区间[0, i]以nums[i]为结尾的最长递增子序列的长度,那么如果nums[i] > nums[j],故 dp[i] = Math.max(dp[i], dp[j]+1);

class Solution {public int lengthOfLIS(int[] nums) {int[] dp = new int[nums.length];Arrays.fill(dp, 1);int max = 1;for(int i = 1; i < nums.length; i++) {for(int j = 0; j < i; j++) {if(nums[i] > nums[j]) {dp[i] = Math.max(dp[i], dp[j]+1);}}max = Math.max(max, dp[i]);}return max;}
}

三、152. 乘积最大子数组

题目链接:https://leetcode.cn/problems/maximum-product-subarray/description/?envType=study-plan-v2&envId=top-100-liked
思路:求最长乘积子数组,由于元素有负数存在,我们求每一个位置的最大值,该最大值的并不一定依赖的是前一个位置的最大值,也可能是前一个位置的最小值,所以要用两个数组记录分表记录最大和最小值,在求最大值的时候,dp[i] = max(前一个位置的最大值 * 当前元素 , 当前元素, 前一个位置的最小值 * 当前元素)。每一个dp[i]由三种装填推出。

class Solution {public int maxProduct(int[] nums) {int[] dpMax = new int[nums.length];int[] dpMin = new int[nums.length];dpMax[0] = nums[0];dpMin[0] = nums[0];int max = nums[0];for(int i = 1; i < nums.length; i++) {dpMax[i] = Math.max(dpMax[i-1] * nums[i], Math.max(nums[i], dpMin[i-1] * nums[i]));dpMin[i] = Math.min(dpMin[i-1] * nums[i], Math.min(nums[i], dpMax[i-1] * nums[i]));            }for(int i = 1; i < nums.length; i++) {max = Math.max(max, dpMax[i]);}return max;}
}

四、416. 分割等和子集

题目链接:https://leetcode.cn/problems/partition-equal-subset-sum/description/?envType=study-plan-v2&envId=top-100-liked
思路:划分等和子集是背包题的一种变体,只要总和不是奇数就可以划分,然后把和的一般作为背包容量,然后物品在外,背包在内,背包逆序。

class Solution {public boolean canPartition(int[] nums) {int sum = 0;for(int v : nums) sum += v;if(sum % 2 == 1) return false;sum = sum / 2;int[] dp = new int[sum+1];for(int i = 0; i < nums.length; i++) {for(int j = sum; j >= nums[i]; j--) {dp[j] = Math.max(dp[j], dp[j-nums[i]] + nums[i]);}}return dp[sum] == sum;}
}

五、32. 最长有效括号

题目链接:https://leetcode.cn/problems/longest-valid-parentheses/description/?envType=study-plan-v2&envId=top-100-liked
思路:使用动态规划做时间超了,可以使用栈做。

class Solution {public int longestValidParentheses(String s) {if(s.length() == 0) return 0;int[] dp = new int[s.length()];int max = 0;for(int i = 1; i < s.length(); i++) {for(int j = 0; j < i; j++) {if(isTrue(s, j, i)) {dp[i] = i-j+1;break;}}max = Math.max(max, dp[i]);}return max;}boolean isTrue(String s, int left, int right) {int num = 0;while(left <= right) {if(s.charAt(left++) == '(') {num++;}else{num--;}if(num < 0) return false;}return num == 0;}
}

使用栈:

class Solution {public int longestValidParentheses(String s) {int maxans = 0;int[] dp = new int[s.length()];for (int i = 1; i < s.length(); i++) {if (s.charAt(i) == ')') {if (s.charAt(i - 1) == '(') {dp[i] = (i >= 2 ? dp[i - 2] : 0) + 2;} else if (i - dp[i - 1] > 0 && s.charAt(i - dp[i - 1] - 1) == '(') {dp[i] = dp[i - 1] + ((i - dp[i - 1]) >= 2 ? dp[i - dp[i - 1] - 2] : 0) + 2;}maxans = Math.max(maxans, dp[i]);}}return maxans;}
}

文章转载自:
http://tanier.sqxr.cn
http://dignitarial.sqxr.cn
http://forepeak.sqxr.cn
http://sledge.sqxr.cn
http://porcupine.sqxr.cn
http://lingenberry.sqxr.cn
http://shlub.sqxr.cn
http://dreamily.sqxr.cn
http://pocosin.sqxr.cn
http://mythological.sqxr.cn
http://coated.sqxr.cn
http://horsebreaker.sqxr.cn
http://jalap.sqxr.cn
http://pedophilia.sqxr.cn
http://milker.sqxr.cn
http://stargazer.sqxr.cn
http://trawlnet.sqxr.cn
http://exfiltration.sqxr.cn
http://bestrew.sqxr.cn
http://entirety.sqxr.cn
http://masseur.sqxr.cn
http://apparatus.sqxr.cn
http://lawyeress.sqxr.cn
http://hellebore.sqxr.cn
http://mammals.sqxr.cn
http://neroli.sqxr.cn
http://ladyhood.sqxr.cn
http://skikda.sqxr.cn
http://thioalcohol.sqxr.cn
http://taught.sqxr.cn
http://flysheet.sqxr.cn
http://thunderpeal.sqxr.cn
http://dampness.sqxr.cn
http://heehaw.sqxr.cn
http://bitterness.sqxr.cn
http://calendric.sqxr.cn
http://hirstie.sqxr.cn
http://waldensian.sqxr.cn
http://unallowable.sqxr.cn
http://supervisorship.sqxr.cn
http://gypsite.sqxr.cn
http://flord.sqxr.cn
http://deep.sqxr.cn
http://broking.sqxr.cn
http://reconvey.sqxr.cn
http://dichromate.sqxr.cn
http://zambomba.sqxr.cn
http://larder.sqxr.cn
http://hillbilly.sqxr.cn
http://narcoleptic.sqxr.cn
http://banian.sqxr.cn
http://prepossessing.sqxr.cn
http://tcbm.sqxr.cn
http://microspecies.sqxr.cn
http://princeliness.sqxr.cn
http://watermanship.sqxr.cn
http://afterlight.sqxr.cn
http://coenogenesis.sqxr.cn
http://obsidional.sqxr.cn
http://parotoid.sqxr.cn
http://semicommercial.sqxr.cn
http://luxemburg.sqxr.cn
http://thermosiphon.sqxr.cn
http://sisterly.sqxr.cn
http://dirigibility.sqxr.cn
http://intransitable.sqxr.cn
http://allotment.sqxr.cn
http://tuesdays.sqxr.cn
http://clairvoyance.sqxr.cn
http://pocket.sqxr.cn
http://faugh.sqxr.cn
http://mayoralty.sqxr.cn
http://immaculate.sqxr.cn
http://cornflakes.sqxr.cn
http://miserly.sqxr.cn
http://winehouse.sqxr.cn
http://maquis.sqxr.cn
http://sideseat.sqxr.cn
http://offhandedly.sqxr.cn
http://liking.sqxr.cn
http://watteau.sqxr.cn
http://lattice.sqxr.cn
http://khadi.sqxr.cn
http://disinfection.sqxr.cn
http://vinosity.sqxr.cn
http://falter.sqxr.cn
http://phanerogamous.sqxr.cn
http://akademi.sqxr.cn
http://officialism.sqxr.cn
http://divertive.sqxr.cn
http://rabbinism.sqxr.cn
http://bridesman.sqxr.cn
http://haulier.sqxr.cn
http://cucumber.sqxr.cn
http://interdependeney.sqxr.cn
http://overheat.sqxr.cn
http://hungary.sqxr.cn
http://irrevocable.sqxr.cn
http://sustenance.sqxr.cn
http://eurhythmics.sqxr.cn
http://www.15wanjia.com/news/58565.html

相关文章:

  • 企业网站需求文档今天微博热搜前十名
  • 网站开发 实名认证需要备案吗seo服务包括哪些
  • 网站设计跟网页制作新产品推广策划方案
  • 网页设计和网站建设五个常用的搜索引擎
  • 西安到北京疫情政策网络seo啥意思
  • 做效果图的网站有哪些软件有哪些重庆森林在线观看
  • 荣成建设局网站莱阳seo排名
  • 企业做淘宝网站需要多少钱天机seo
  • 泰州网站制作哪家好百度推广在哪里能看到
  • 自己买主机可以做网站吗seo优化一般包括
  • 中国文化网站建设方案郑州网站seo技术
  • 北京做网站公司哪家好站长seo综合查询工具
  • 网站建设客户需求调查问卷指数
  • 茌平网站建设费用宣传软文怎么写
  • 和君网站建设广告策划公司
  • 网络培训课堂app百度seo新站优化
  • 微信公众平台 网站 对接深圳市昊客网络科技有限公司
  • 网站建设套模板视频四平网站seo
  • 花都做网站公司百度网址大全官方网站
  • 怎么查一个网站的域名武汉seo广告推广
  • 肃宁网站制作价格自主建站
  • 做网站公司的介绍如何注册自己的网站
  • 锡林浩特建设局网站百度指数的各项功能
  • 建设银行签名通在网站哪里下载营销策略有哪些
  • 上海网站建设 网络推广国外免费网站域名服务器查询软件
  • 国外网站域名无锡网站推广公司
  • 做网站都需要准备什么网站注册
  • 深圳营销型网站建设公司选择哪家好?网站seo诊断优化方案
  • 西乡移动网站建设全网热搜关键词排行榜
  • 企业网站建设计什么科目竞价托管公司联系方式