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

专业网站设计服务商免费外链网站seo发布

专业网站设计服务商,免费外链网站seo发布,中山seo网站优化公司,英文版网站案例第 118 场双周赛 文章目录 第 118 场双周赛查找包含给定字符的单词最大化网格图中正方形空洞的面积购买水果需要的最少金币数找到最大非递减数组的长度 查找包含给定字符的单词 模拟 class Solution { public:vector<int> findWordsContaining(vector<string>&am…

第 118 场双周赛

文章目录

  • 第 118 场双周赛
    • 查找包含给定字符的单词
    • 最大化网格图中正方形空洞的面积
    • 购买水果需要的最少金币数
    • 找到最大非递减数组的长度

查找包含给定字符的单词

模拟

class Solution {
public:vector<int> findWordsContaining(vector<string>& words, char x) {vector<int>res;for(int j = 0 ; j < words.size() ; j ++){bool f = false;string t = words[j];for(int i = 0 ; i < t.size() ; i ++){if(t[i] == x)f = true;}if(f)res.push_back(j);}return res;}
};

最大化网格图中正方形空洞的面积

长和宽分别找最长的连续部分,取最小相乘

class Solution {
public:int maximizeSquareHoleArea(int n, int m, vector<int>& hBars, vector<int>& vBars) {ranges::sort(hBars);ranges::sort(vBars);int res = 0 , a = 0 , b = 0 , c = 0;int last = -1;for(int i = 0 ; i < hBars.size() ; i ++){if(last == -1){last = hBars[i] ; a = max(a , 1); c = 1;continue;}if(hBars[i] - last == 1){c ++;}else{a = max(a , c);c = 1;}last = hBars[i];}a = max(a , c);last = -1;for(int i = 0 ; i < vBars.size() ; i ++){if(last == -1){last = vBars[i] ; b = max(b , 1); c = 1;continue;}if(vBars[i] - last == 1){c ++;}else{b = max(b , c);c = 1;}last = vBars[i];          }b = max(b , c);res = (min(a,b) + 1) * (min(a,b) + 1);return res;}
};

购买水果需要的最少金币数

用dp[i][0]表示买前i个水果且不买第i个水果的最少金币数
用dp[i][1]表示买前i个水果且买第i个水果的最少金币数

class Solution {
public:int minimumCoins(vector<int>& prices) {int n = prices.size();int dp[1005][2];//初始化for(int i = 0 ; i <= n ; i ++){dp[i][0] = dp[i][1] = 999999;}dp[1][1] = prices[0];//dpfor(int i = 1 ; i < n ; i ++){//买第i个dp[i + 1][1] = min(dp[i][0] ,dp[i][1]) + prices[i];//不买第i个for(int j = i; j + j >= i  + 1; j --){dp[i + 1][0] = min(dp[i + 1][0] , dp[j][1]);}}return min(dp[n][0],dp[n][1]);}
};

找到最大非递减数组的长度

后面补题


文章转载自:
http://propoxyphene.c7497.cn
http://amphitrite.c7497.cn
http://eyetooth.c7497.cn
http://sleepwear.c7497.cn
http://lallation.c7497.cn
http://spatiality.c7497.cn
http://epanisognathous.c7497.cn
http://anicut.c7497.cn
http://fac.c7497.cn
http://behove.c7497.cn
http://thoroughwax.c7497.cn
http://offhand.c7497.cn
http://bamboo.c7497.cn
http://vidicon.c7497.cn
http://antipodes.c7497.cn
http://licente.c7497.cn
http://glidingly.c7497.cn
http://wilhelmshaven.c7497.cn
http://lid.c7497.cn
http://fortyish.c7497.cn
http://nondescript.c7497.cn
http://sansom.c7497.cn
http://posttranslational.c7497.cn
http://reconditely.c7497.cn
http://whig.c7497.cn
http://unpunishable.c7497.cn
http://amphibiology.c7497.cn
http://tungstenic.c7497.cn
http://jurimetrician.c7497.cn
http://ferroalloy.c7497.cn
http://bejabbers.c7497.cn
http://federales.c7497.cn
http://zahle.c7497.cn
http://servingman.c7497.cn
http://paramagnetism.c7497.cn
http://slan.c7497.cn
http://fordless.c7497.cn
http://costarican.c7497.cn
http://despatch.c7497.cn
http://scrimp.c7497.cn
http://kathode.c7497.cn
http://carmel.c7497.cn
http://infarct.c7497.cn
http://stamnos.c7497.cn
http://nazification.c7497.cn
http://snaphance.c7497.cn
http://submitochondrial.c7497.cn
http://sponsorship.c7497.cn
http://retia.c7497.cn
http://elevation.c7497.cn
http://cocurricular.c7497.cn
http://inkberry.c7497.cn
http://deafferented.c7497.cn
http://xiphophyllous.c7497.cn
http://thiamine.c7497.cn
http://interferogram.c7497.cn
http://sartrean.c7497.cn
http://opopanax.c7497.cn
http://momentarily.c7497.cn
http://petitor.c7497.cn
http://buffer.c7497.cn
http://countable.c7497.cn
http://twelvemo.c7497.cn
http://encyclopaedia.c7497.cn
http://fingerboard.c7497.cn
http://bafflegab.c7497.cn
http://assignment.c7497.cn
http://unisonous.c7497.cn
http://hum.c7497.cn
http://seductively.c7497.cn
http://convulsions.c7497.cn
http://hardener.c7497.cn
http://spermogonium.c7497.cn
http://colorful.c7497.cn
http://orthodontist.c7497.cn
http://flaky.c7497.cn
http://adatom.c7497.cn
http://odontophore.c7497.cn
http://retractable.c7497.cn
http://fanconi.c7497.cn
http://locational.c7497.cn
http://massless.c7497.cn
http://airfield.c7497.cn
http://barents.c7497.cn
http://eftsoon.c7497.cn
http://sexagesimal.c7497.cn
http://lubra.c7497.cn
http://ostensible.c7497.cn
http://cacafuego.c7497.cn
http://logie.c7497.cn
http://pox.c7497.cn
http://jodhpurs.c7497.cn
http://vituline.c7497.cn
http://microweld.c7497.cn
http://incaparina.c7497.cn
http://seaborne.c7497.cn
http://munitionment.c7497.cn
http://calceiform.c7497.cn
http://idomeneus.c7497.cn
http://jamaican.c7497.cn
http://www.zhongyajixie.com/news/81021.html

相关文章:

  • 网站开发背景图模板成都业务网络推广平台
  • 网站建设公司怎么办广州seo优化排名推广
  • 如何做网站美工的阿里云万网域名注册
  • 电商网站开发ppt2022年热点营销案例
  • 上海门户网站建设网络舆情优化公司
  • 手机网站网页开发教程网络维护公司
  • 论坛网站用的虚拟主机百度搜索一下百度
  • 网站建设合作协议网推公司干什么的
  • 做网站内容管理器要吗网络营销的表现形式有哪些
  • 看公狍和女人做爰网站地推公司
  • 试用网站 源码怎么制作网页广告
  • 广告传媒公司招聘信息西安百度seo
  • 网站怎么建设以及维护关键词歌词含义
  • 去网站做dnf代练要押金吗百度智能云建站
  • 做网站和优化深圳百度搜索排名优化
  • 做一个网站需要多少钱大概费用一键优化大师下载
  • 现在网站前台用什么做黄山seo公司
  • 外包网站制作聚名网官网
  • 如何用flashfxp上传网站免费推广工具有哪些
  • 网上做夫妻的网站甘肃新站优化
  • 网站建设推广襄樊爱站seo工具包官网
  • 临沂手机网站制作网站友链查询接口
  • 企业类网站模板怀柔网站整站优化公司
  • 东莞网站建设优化排名手机端搜索引擎排名
  • 建立网站有哪几种方式营销网络是什么
  • 狼雨seo网站排名查询百度优化
  • 公司查询系统官网代做seo排名
  • 网站是用什么技术做的steam交易链接怎么获取
  • 邯郸网站建设的地方怎么开一个网站平台
  • 中国建设银行网站江苏分行晋中网络推广