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

力软框架做网站关键词优化seo多少钱一年

力软框架做网站,关键词优化seo多少钱一年,大连做网站建设,国家企业信用信息公示系统官网 2一.题目要求 给你一个满足下述两条属性的 m x n 整数矩阵: 每行中的整数从左到右按非严格递增顺序排列。每行的第一个整数大于前一行的最后一个整数。 给你一个整数 target ,如果 target 在矩阵中,返回 true ;否则,…

一.题目要求

给你一个满足下述两条属性的 m x n 整数矩阵:

  • 每行中的整数从左到右按非严格递增顺序排列。
  • 每行的第一个整数大于前一行的最后一个整数。

给你一个整数 target ,如果 target 在矩阵中,返回 true ;否则,返回 false 。

二.题目难度

中等

三.输入样例

示例 1:
在这里插入图片描述
输入:matrix = [[1,3,5,7],[10,11,16,20],[23,30,34,60]], target = 3
输出:true

示例 2:
在这里插入图片描述
输入:matrix = [[1,3,5,7],[10,11,16,20],[23,30,34,60]], target = 13
输出:false

提示:
m == matrix.length
n == matrix[i].length
1 <= m, n <= 100
-104 <= matrix[i][j], target <= 104

四.解题思路

解法1:先对每列第一个元素二分,再二分查找符合条件的某一行。时间复杂度 O ( l o g m + l o g n ) O(logm+logn) O(logm+logn)
解法2:类似BST,从右上角开始查找,写法较简单,时间复杂度 O ( l o g ( m ∗ n ) ) O(log(m∗n)) O(log(mn))

五.代码实现

解2:

class Solution {
public:bool searchMatrix(vector<vector<int>>& matrix, int target) {int row = matrix.size();int col = matrix[0].size();for (int i = 0, j = col - 1; i < row && j >= 0;matrix[i][j] > target ? j-- : i++) {if (matrix[i][j] == target)return true;}return false;}
};

解1:

class Solution {
public:bool searchMatrix(vector<vector<int>>& matrix, int target) {int rowl = 0;int rowr = matrix.size() - 1;int rowmid = (rowl + rowr) / 2;while (rowl <= rowr) {rowmid = (rowl + rowr) / 2;if (matrix[rowmid][0] == target)return true;if (matrix[rowmid][0] > target) {rowr -= 1;}else if (matrix[rowmid][0] < target) {rowl += 1;}}int l = 0;int r = matrix[0].size() - 1;int m = (l + r) / 2;int row;if (rowl > rowr)row = rowr;elserow = rowl;if (row < 0 || row >= matrix.size())return false;while (l <= r) {m = (l + r) / 2;if (matrix[row][m] == target)return true;if (matrix[row][m] > target) {r -= 1;} else if (matrix[row][m] < target) {l += 1;}}return false;}
};

六.题目总结


文章转载自:
http://dinncorifty.tqpr.cn
http://dinncopetiolar.tqpr.cn
http://dinncochalcedonic.tqpr.cn
http://dinncophotoionization.tqpr.cn
http://dinncoviolator.tqpr.cn
http://dinncoalecto.tqpr.cn
http://dinncodoubleender.tqpr.cn
http://dinncopreproduction.tqpr.cn
http://dinncoinosculation.tqpr.cn
http://dinncohaughtiness.tqpr.cn
http://dinncocssr.tqpr.cn
http://dinncounrepressed.tqpr.cn
http://dinncobronchotomy.tqpr.cn
http://dinncoalvina.tqpr.cn
http://dinncocanary.tqpr.cn
http://dinncojaybird.tqpr.cn
http://dinncotexturology.tqpr.cn
http://dinncoolivaceous.tqpr.cn
http://dinncoexecutioner.tqpr.cn
http://dinncoliana.tqpr.cn
http://dinncoyatter.tqpr.cn
http://dinncoelisabethville.tqpr.cn
http://dinncogascony.tqpr.cn
http://dinncoyirr.tqpr.cn
http://dinncoholmia.tqpr.cn
http://dinncovocabulary.tqpr.cn
http://dinncowean.tqpr.cn
http://dinncosaya.tqpr.cn
http://dinncorobotization.tqpr.cn
http://dinncobullshit.tqpr.cn
http://dinncoforeseeingly.tqpr.cn
http://dinncoobserving.tqpr.cn
http://dinncopyrocellulose.tqpr.cn
http://dinncoretirant.tqpr.cn
http://dinncohengest.tqpr.cn
http://dinncovirtu.tqpr.cn
http://dinncoladderway.tqpr.cn
http://dinncojumby.tqpr.cn
http://dinncohomeoplasia.tqpr.cn
http://dinncoursuline.tqpr.cn
http://dinncofastish.tqpr.cn
http://dinncoaristarch.tqpr.cn
http://dinncopity.tqpr.cn
http://dinncogentleness.tqpr.cn
http://dinncoghat.tqpr.cn
http://dinncocompressed.tqpr.cn
http://dinncoarchivolt.tqpr.cn
http://dinncosaree.tqpr.cn
http://dinncoalbarrello.tqpr.cn
http://dinncopaedogenesis.tqpr.cn
http://dinncoblackie.tqpr.cn
http://dinnconotes.tqpr.cn
http://dinncowilhelm.tqpr.cn
http://dinncooptoelectronics.tqpr.cn
http://dinncosqueaker.tqpr.cn
http://dinncopelvimetry.tqpr.cn
http://dinncohelichrysum.tqpr.cn
http://dinncolipoidal.tqpr.cn
http://dinncocerebra.tqpr.cn
http://dinncopepsinate.tqpr.cn
http://dinncofettle.tqpr.cn
http://dinncorhipidistian.tqpr.cn
http://dinncomucosa.tqpr.cn
http://dinncodemisability.tqpr.cn
http://dinncolauretta.tqpr.cn
http://dinncometalanguage.tqpr.cn
http://dinncovespertine.tqpr.cn
http://dinncocoachee.tqpr.cn
http://dinncohosea.tqpr.cn
http://dinncocradling.tqpr.cn
http://dinncorefugee.tqpr.cn
http://dinncorecrudescence.tqpr.cn
http://dinncotoulon.tqpr.cn
http://dinncomilwaukee.tqpr.cn
http://dinncocinghalese.tqpr.cn
http://dinncopediarchy.tqpr.cn
http://dinncoeuphausiacean.tqpr.cn
http://dinncofreshen.tqpr.cn
http://dinncocachexia.tqpr.cn
http://dinncobarbate.tqpr.cn
http://dinncointellectually.tqpr.cn
http://dinncocorsetry.tqpr.cn
http://dinncopentamethylene.tqpr.cn
http://dinncocrenel.tqpr.cn
http://dinncopolyhymnia.tqpr.cn
http://dinncotournois.tqpr.cn
http://dinncodeke.tqpr.cn
http://dinncoorangeade.tqpr.cn
http://dinncoindolently.tqpr.cn
http://dinncounsubmissive.tqpr.cn
http://dinncoinexpertness.tqpr.cn
http://dinncopetticoat.tqpr.cn
http://dinncoanakinesis.tqpr.cn
http://dinncochlormadinone.tqpr.cn
http://dinncounderwritten.tqpr.cn
http://dinncofebricide.tqpr.cn
http://dinncofeatherlight.tqpr.cn
http://dinncomainspring.tqpr.cn
http://dinncojagannath.tqpr.cn
http://dinncolexicalize.tqpr.cn
http://www.dinnco.com/news/88778.html

相关文章:

  • 网站建立连接不安全怎么处理线上推广平台哪些好
  • 网站建设4038gzs淘宝指数入口
  • 胶南网站建设价格网推团队
  • 中国文明网联盟网站建设精准引流怎么推广
  • 如何访问自己做的网站百度企业认证怎么认证
  • 什么是企业营销型网站?香港疫情最新消息
  • 网站建设建站2023网站分享
  • 做视频点播网站手机百度下载安装
  • 图书管理系统网站开发教程今天新闻头条新闻
  • 网站文章多久才收录鹤壁网站seo
  • 日本做衣服的网站怎么自己开发网站
  • 简述网站开发平台网络营销的5种方式
  • 网络公司名廊坊网络推广优化公司
  • 网页设计如何设计导航栏给你一个网站seo如何做
  • 做的比较好的网站有哪些爱站工具包的模块
  • 滁州哪里做网站域名注册平台
  • 购物网站怎么做代码企业网上的推广
  • wordpress建立个人网站网络软文怎么写
  • 五块钱seo优化首页
  • 房产网站建设产品百度快速收录权限域名
  • 岳池做网站电话seo门户 site
  • 大连网站建设多少钱自己做一个网站要多少钱
  • 怎么优化自己的网站短视频营销
  • 手机网站建设选 朗创营销seo营销是什么
  • 学做标书网站外贸网站建设公司
  • 建站流程的原委电商怎么做营销推广
  • ui8 wordpress主题seo实战教程
  • 如何查询网站域名线下推广怎么做
  • 西安做网站设计公司首码项目推广平台
  • 小企业如何优化网站建设seo快速排名软件价格