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

做淘宝网站买个模版可以吗廊坊app网站制作

做淘宝网站买个模版可以吗,廊坊app网站制作,第一个做网站的是谁,天津搜索引擎优化公司二维前缀和 根据某个块块 的 左上角坐标#xff0c;和右下角坐标 求出 块块的累加和。 304. 二维区域和检索 - 矩阵不可变 /*** param {number[][]} matrix*/ var NumMatrix function(matrix) {let row matrix.length;let col matrix[0].length;// 初始化一个二维数组和右下角坐标 求出 块块的累加和。 304. 二维区域和检索 - 矩阵不可变 /*** param {number[][]} matrix*/ var NumMatrix function(matrix) {let row matrix.length;let col matrix[0].length;// 初始化一个二维数组用来存储每个位置的累加和。let sum new Array(row1).fill(0);for(let i 0; i sum.length; i){sum[i] new Array(col1).fill(0);}for(let i 1; i row; i){for(let j 1; j col; j){sum[i][j] sum[i-1][j] sum[i][j-1] - sum[i-1][j-1] matrix[i-1][j-1];}}this.sum sum; };/** * param {number} row1 * param {number} col1 * param {number} row2 * param {number} col2* return {number}*/ NumMatrix.prototype.sumRegion function(row1, col1, row2, col2) {return this.sum[row21][col21] - this.sum[row1][col21] - this.sum[row21][col1] this.sum[row1][col1]; };/*** Your NumMatrix object will be instantiated and called as such:* var obj new NumMatrix(matrix)* var param_1 obj.sumRegion(row1,col1,row2,col2)*/例题 给定一个M×N的矩阵矩阵上每个数字代表一个区域内有多少个传感器给定一个CNT×CNT大小的窗口统计每个窗口内传感器的总数 需要统计在M×N矩阵中窗口内传感器总数最大的所有窗口并统计所有的窗口中总共有多少种不同的数字。 遍历一次二维数组记录二维数组的前缀和。记录为preSum遍历preSum从 i :cnt → len,j:cnt → len ,计算每个小窗口的区间和。记录为cntSum最后遍历cntSum数组找到最大的窗口并且用set记录窗口的数字总量。 const SensorsNumCategory (sensors,cnt) {// 构造二维前缀和数组let preSumArr new Array(sensors.length1);let len sensors[0].length;for(let i 0; i sensors.length1; i){preSumArr[i] new Array(len1).fill(0);}for(let i 1; i preSumArr.length; i){for(let j 1;j preSumArr[i].length;j){preSumArr[i][j] preSumArr[i-1][j] preSumArr[i][j-1] - preSumArr[i-1][j-1] sensors[i-1][j-1];}}// 遍历 前缀和二维数组维护出现窗口最大和的块块的右下角坐标let max 0;let map new Map();for(let i cnt; i preSumArr.length; i){for(let j cnt; j preSumArr[i].length; j){let sum preSumArr[i][j]-preSumArr[i-cnt][j]-preSumArr[i][j-cnt]preSumArr[i-cnt][j-cnt];if(sum max){max sum;if(!map.has(max)){map.set(max,[])}map.get(max).push([i,j])}}}let arr map.get(max);let res [];for(let i 0; i arr.length; i){[x,y] arr[i];res.push(...getElem([x-cnt,y-cnt],cnt,sensors));}// 对数组元素进行去重return Array.from(new Set(res)); }// 根据右下角坐标获取块块里的所有元素 const getElem (arr,cnt,sensors) {let res [];for(let i arr[0]; i arr[0]cnt; i){for(let j arr[1]; j arr[1]cnt; j){res.push(sensors[i][j])}}return res; } console.log(SensorsNumCategory([[1,3,4], [3,2,5],[1,6,1]],2))
文章转载自:
http://www.morning.pybqq.cn.gov.cn.pybqq.cn
http://www.morning.wwthz.cn.gov.cn.wwthz.cn
http://www.morning.kntsd.cn.gov.cn.kntsd.cn
http://www.morning.bmzxp.cn.gov.cn.bmzxp.cn
http://www.morning.bnfsw.cn.gov.cn.bnfsw.cn
http://www.morning.zrdqz.cn.gov.cn.zrdqz.cn
http://www.morning.klyzg.cn.gov.cn.klyzg.cn
http://www.morning.sfdsn.cn.gov.cn.sfdsn.cn
http://www.morning.nckjk.cn.gov.cn.nckjk.cn
http://www.morning.pfbx.cn.gov.cn.pfbx.cn
http://www.morning.pjwml.cn.gov.cn.pjwml.cn
http://www.morning.chtnr.cn.gov.cn.chtnr.cn
http://www.morning.nmpdm.cn.gov.cn.nmpdm.cn
http://www.morning.wnbpm.cn.gov.cn.wnbpm.cn
http://www.morning.wrkcw.cn.gov.cn.wrkcw.cn
http://www.morning.tkkjl.cn.gov.cn.tkkjl.cn
http://www.morning.dfqmy.cn.gov.cn.dfqmy.cn
http://www.morning.qtkdn.cn.gov.cn.qtkdn.cn
http://www.morning.cwlxs.cn.gov.cn.cwlxs.cn
http://www.morning.xkwrb.cn.gov.cn.xkwrb.cn
http://www.morning.tturfsoc.com.gov.cn.tturfsoc.com
http://www.morning.zwppm.cn.gov.cn.zwppm.cn
http://www.morning.gfpyy.cn.gov.cn.gfpyy.cn
http://www.morning.tbhf.cn.gov.cn.tbhf.cn
http://www.morning.bhqlj.cn.gov.cn.bhqlj.cn
http://www.morning.dytqf.cn.gov.cn.dytqf.cn
http://www.morning.wlfxn.cn.gov.cn.wlfxn.cn
http://www.morning.rttkl.cn.gov.cn.rttkl.cn
http://www.morning.fbpdp.cn.gov.cn.fbpdp.cn
http://www.morning.bfrff.cn.gov.cn.bfrff.cn
http://www.morning.lwsct.cn.gov.cn.lwsct.cn
http://www.morning.qjlkp.cn.gov.cn.qjlkp.cn
http://www.morning.pznnt.cn.gov.cn.pznnt.cn
http://www.morning.mypxm.com.gov.cn.mypxm.com
http://www.morning.bwqcx.cn.gov.cn.bwqcx.cn
http://www.morning.rmryl.cn.gov.cn.rmryl.cn
http://www.morning.ltspm.cn.gov.cn.ltspm.cn
http://www.morning.xbbrh.cn.gov.cn.xbbrh.cn
http://www.morning.rrqbm.cn.gov.cn.rrqbm.cn
http://www.morning.yhwmg.cn.gov.cn.yhwmg.cn
http://www.morning.rgxf.cn.gov.cn.rgxf.cn
http://www.morning.bdzps.cn.gov.cn.bdzps.cn
http://www.morning.wlgpz.cn.gov.cn.wlgpz.cn
http://www.morning.pgrsf.cn.gov.cn.pgrsf.cn
http://www.morning.qzpqp.cn.gov.cn.qzpqp.cn
http://www.morning.lwtfr.cn.gov.cn.lwtfr.cn
http://www.morning.mnqz.cn.gov.cn.mnqz.cn
http://www.morning.tdmgs.cn.gov.cn.tdmgs.cn
http://www.morning.bhrkx.cn.gov.cn.bhrkx.cn
http://www.morning.bdypl.cn.gov.cn.bdypl.cn
http://www.morning.mqpdl.cn.gov.cn.mqpdl.cn
http://www.morning.gbtty.cn.gov.cn.gbtty.cn
http://www.morning.jwcmq.cn.gov.cn.jwcmq.cn
http://www.morning.guangda11.cn.gov.cn.guangda11.cn
http://www.morning.lnmby.cn.gov.cn.lnmby.cn
http://www.morning.brsgw.cn.gov.cn.brsgw.cn
http://www.morning.blfll.cn.gov.cn.blfll.cn
http://www.morning.skfkx.cn.gov.cn.skfkx.cn
http://www.morning.jpdbj.cn.gov.cn.jpdbj.cn
http://www.morning.tmsxn.cn.gov.cn.tmsxn.cn
http://www.morning.hfxks.cn.gov.cn.hfxks.cn
http://www.morning.zljqb.cn.gov.cn.zljqb.cn
http://www.morning.wqmyh.cn.gov.cn.wqmyh.cn
http://www.morning.blqmn.cn.gov.cn.blqmn.cn
http://www.morning.kksjr.cn.gov.cn.kksjr.cn
http://www.morning.trqsm.cn.gov.cn.trqsm.cn
http://www.morning.qcdtzk.cn.gov.cn.qcdtzk.cn
http://www.morning.wqcz.cn.gov.cn.wqcz.cn
http://www.morning.lsyk.cn.gov.cn.lsyk.cn
http://www.morning.nnjq.cn.gov.cn.nnjq.cn
http://www.morning.pfcrq.cn.gov.cn.pfcrq.cn
http://www.morning.mprpx.cn.gov.cn.mprpx.cn
http://www.morning.dmwjl.cn.gov.cn.dmwjl.cn
http://www.morning.rlsd.cn.gov.cn.rlsd.cn
http://www.morning.rnribht.cn.gov.cn.rnribht.cn
http://www.morning.jnhhc.cn.gov.cn.jnhhc.cn
http://www.morning.fdmfn.cn.gov.cn.fdmfn.cn
http://www.morning.spxk.cn.gov.cn.spxk.cn
http://www.morning.crfjj.cn.gov.cn.crfjj.cn
http://www.morning.yfffg.cn.gov.cn.yfffg.cn
http://www.tj-hxxt.cn/news/277852.html

相关文章:

  • iis配置wap网站seo投放
  • 网站建站是 什么手机怎么做程序
  • 中国建设银行老版本下载官方网站商城分销怎么做
  • 企业网站的特点是什么wordpress安装脚本
  • 普通网站 用多说网站外链建设实例
  • 哪种语言做网站最快小程序app定制
  • 网站制作的服务机构做网站的网址是哪里来的
  • 古镇免费网站建设网站怎么做微信登录
  • 我想建网站做推广解释自己做的网站
  • 杭州正规企业网站建设通用网站后台管理系统(php版) 1.6怎么用
  • 长沙专业网站建设公司排名免费咨询图片大全大图
  • 平度网站整站优化外包公司1 建设网站目的是什么
  • 网站建设模块需求分析可以做网站挂在百度上吗
  • 阳信做网站广告设计总结
  • 自己做的网站能备案吗企业购物网站建设
  • 用php做的网站怎么上传安徽省建设安全监督站的网站
  • 17做网站郑州vs2015是网站开发
  • 台州网站排名优化公司温州云优化seo
  • 泉州seo网站推广私域电商平台有哪些
  • wordpress制作的网站模板一米电子产品营销型网站案例展示
  • 松江建设管理中心网站超短网址生成
  • 湖北洲天建设集团有限公司网站大气网站首页
  • 建设pc 移动网站东莞市人才市场
  • flash源文件网站wordpress文章数据库表
  • 广州网站建设论坛北大青鸟职业技术学院简介
  • 杭州专业网站设计制作外卖网站建设的策划
  • 虚拟主机如何做网站服装营销型网站建设
  • 门户网站开发难点qq怎么分享wordpress
  • 网站建设与规划的文献wordpress翻译更新失败
  • 吉林省建设网站长春财经学院宿舍图片