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

网络公司除了做网站百家联盟推广部电话多少

网络公司除了做网站,百家联盟推广部电话多少,网站备案查询工信部app,北京最新文章目录 一.二维差分构造差分二维数组二维差分算法状态dp求b[i][j]数组的二维前缀和图解 二.三维前缀和与差分三维前缀和图解:三维差分核心公式图解:模板题 一.二维差分 给定一个原二维数组a[i][j],若要给a[i][j]中以(x1,y1)和(x2,y2)为对角线的子矩阵中每个数都加上一个常数…

在这里插入图片描述

文章目录

  • 一.二维差分
    • 构造差分二维数组
    • 二维差分算法
    • 状态dp求b[i][j]数组的二维前缀和图解
  • 二.三维前缀和与差分
    • 三维前缀和图解:
    • 三维差分核心公式图解:
    • 模板题

一.二维差分

  • 给定一个原二维数组a[i][j],若要给a[i][j]中以(x1,y1)(x2,y2)为对角线的子矩阵中每个数都加上一个常数c,暴力的做法时间复杂度为O(N^2),使用二维差分可以在O(1)的时间复杂度内完成该操作
    在这里插入图片描述

构造差分二维数组

  • 构造差分二维数组b[i][j]使得原二维数组a[i][j]是二维数组b[i][j]的二维前缀和数组,即满足:
    在这里插入图片描述
    在这里插入图片描述

二维差分算法

  • 若使原数组a[i][j]中以(x1,y1)(x2,y2)为对角线的子矩阵中每个数都加上一个常数c,等价于对b[i][j]数组进行如下操作:
    • b[x1][y1] += c
    • b[x2+1][y2+1] += c
    • b[x2+1][y1] -= c
    • b[x1][y2+1] -= c
  • 核心操作接口:
//使原数组a[i][j]中以(x1,y1)和(x2,y2)为对角线的子矩阵中每个数都加上一个常数c
//接口可以用于构造差分矩阵以及进行原数组的矩阵元素整体修改操作
void Matrix_Add(long long(*b)[1010],int x1 ,int y1,int x2 ,int y2,int c){b[x1][y1] += c;b[x2+1][y2+1] += c;b[x1][y2+1] -= c;b[x2+1][y1] -= c;
}
//状态递推法对b[i][j]数组求二维前缀和,以获取原数组的元素--> 默认矩阵第0行第0列全部元素为0
void Get_Pre_Sum(long long(*b)[1010],int row , int col){//求(1,1)~(i,j)的子矩阵的和for(int i = 1 ; i <= row ; ++i){for(int j = 1 ; j<=col ; ++j){b[i][j] += (b[i-1][j] + b[i][j-1] - b[i-1][j-1]);}}
}
  • 求出b[i][j]数组的二维前缀和就可以恢复原数组a[i][j]

状态dp求b[i][j]数组的二维前缀和图解

在这里插入图片描述

二.三维前缀和与差分

三维前缀和图解:

在这里插入图片描述

  • 前缀和递推构造接口:
void Get_Pre_Sum(vector<vector<vector<long long>>>& Board,int high,int row,int col ){for(int i = 1 ; i <= high ; ++i){for(int j = 1 ;  j <= row ; ++j){for(int k = 1 ; k <= col ; ++k){Board[i][j][k] += Board[i-1][j][k] + Board[i][j-1][k] - Board[i-1][j-1][k] +Board[i][j][k-1] - Board[i-1][j][k-1] - Board[i][j-1][k-1] + Board[i-1][j-1][k-1];}}}
}

三维差分核心公式图解:

在这里插入图片描述

  • "相邻点"的加减满足容斥关系,相邻互斥,相间相容
  • 核心公式接口:
void Matrix_Add(vector<vector<vector<long long>>>& Board,int x1 , int y1 , int z1 , int x2 , int y2 , int z2 , int c){Board[x1][y1][z1] += c;Board[x1][y2+1][z1] -= c;Board[x2+1][y1][z1] -= c;Board[x2+1][y2+1][z1] += c;Board[x1][y1][z2+1] -= c;Board[x1][y2+1][z2+1] += c;Board[x2+1][y1][z2+1] += c;Board[x2+1][y2+1][z2+1] -= c;
}

模板题

差分模板题1
差分模板题2

在这里插入图片描述


文章转载自:
http://dinncoisoagglutinogen.ssfq.cn
http://dinncoglossographer.ssfq.cn
http://dinncoteno.ssfq.cn
http://dinncopopie.ssfq.cn
http://dinncotalisman.ssfq.cn
http://dinncodalmane.ssfq.cn
http://dinncowardenship.ssfq.cn
http://dinncotaphephobia.ssfq.cn
http://dinncoechinoid.ssfq.cn
http://dinncomisogynist.ssfq.cn
http://dinncobossdom.ssfq.cn
http://dinncohepatopexy.ssfq.cn
http://dinncoricey.ssfq.cn
http://dinncocaveatee.ssfq.cn
http://dinncofinance.ssfq.cn
http://dinncobalefire.ssfq.cn
http://dinncosupranatural.ssfq.cn
http://dinncocervid.ssfq.cn
http://dinncoissuer.ssfq.cn
http://dinncovolscian.ssfq.cn
http://dinncosarka.ssfq.cn
http://dinncopietist.ssfq.cn
http://dinncopreediting.ssfq.cn
http://dinncoround.ssfq.cn
http://dinncointent.ssfq.cn
http://dinncoincoherently.ssfq.cn
http://dinncopuzzlepated.ssfq.cn
http://dinncopatriciate.ssfq.cn
http://dinncovelure.ssfq.cn
http://dinncothumbmark.ssfq.cn
http://dinncoprovocation.ssfq.cn
http://dinncomahaleb.ssfq.cn
http://dinncoshowing.ssfq.cn
http://dinncoonthe.ssfq.cn
http://dinnconumerology.ssfq.cn
http://dinncoineffective.ssfq.cn
http://dinncooccurrent.ssfq.cn
http://dinncoirritancy.ssfq.cn
http://dinncoskylon.ssfq.cn
http://dinnconested.ssfq.cn
http://dinncomesmerization.ssfq.cn
http://dinncond.ssfq.cn
http://dinncosystematizer.ssfq.cn
http://dinncosuspensibility.ssfq.cn
http://dinncoironical.ssfq.cn
http://dinncojohnboat.ssfq.cn
http://dinncomicrobicide.ssfq.cn
http://dinncojapanese.ssfq.cn
http://dinncointimidate.ssfq.cn
http://dinncotackey.ssfq.cn
http://dinncounremittingly.ssfq.cn
http://dinncoprocephalic.ssfq.cn
http://dinncothermocoagulation.ssfq.cn
http://dinncograveside.ssfq.cn
http://dinncounbar.ssfq.cn
http://dinncocockloft.ssfq.cn
http://dinncokyoto.ssfq.cn
http://dinncoaggrieve.ssfq.cn
http://dinncoarcticologist.ssfq.cn
http://dinncoprecipitator.ssfq.cn
http://dinncosauceboat.ssfq.cn
http://dinncoheartstring.ssfq.cn
http://dinncovoluntarily.ssfq.cn
http://dinncodyscrasite.ssfq.cn
http://dinncotrumpet.ssfq.cn
http://dinncoperpetrate.ssfq.cn
http://dinncosubtropics.ssfq.cn
http://dinncodisemboguement.ssfq.cn
http://dinncocarrie.ssfq.cn
http://dinncoboatswain.ssfq.cn
http://dinncopsychotherapeutics.ssfq.cn
http://dinncomawsie.ssfq.cn
http://dinncoxography.ssfq.cn
http://dinncotheta.ssfq.cn
http://dinncogremlin.ssfq.cn
http://dinncobattik.ssfq.cn
http://dinncohornstone.ssfq.cn
http://dinncoeditorially.ssfq.cn
http://dinncolegally.ssfq.cn
http://dinncoantiremonstrant.ssfq.cn
http://dinncofretful.ssfq.cn
http://dinncohistoric.ssfq.cn
http://dinncotamworth.ssfq.cn
http://dinncogrant.ssfq.cn
http://dinncoinhabited.ssfq.cn
http://dinncorefect.ssfq.cn
http://dinncoimpartibility.ssfq.cn
http://dinncoadjunction.ssfq.cn
http://dinnconotwithstanding.ssfq.cn
http://dinncointerfertile.ssfq.cn
http://dinncocollaboration.ssfq.cn
http://dinncospitdevil.ssfq.cn
http://dinncodiscomfort.ssfq.cn
http://dinncoeoka.ssfq.cn
http://dinncodub.ssfq.cn
http://dinncocent.ssfq.cn
http://dinncomagnificent.ssfq.cn
http://dinncotranslucent.ssfq.cn
http://dinncocanescence.ssfq.cn
http://dinncoasterisk.ssfq.cn
http://www.dinnco.com/news/141794.html

相关文章:

  • 网站首页的滚动大图怎么做电商推广联盟
  • 网站建设备案流程路由优化大师
  • 360免费建站app微信视频号怎么推广引流
  • 狮岭做包包的网站营销策划品牌策划
  • 网站开发就业网站设计费用
  • php做网站 价格外贸营销型网站设计
  • 找个兼职做网站的seo网络排名优化
  • 石景山 网站建设whois域名查询
  • 泰安市齐鲁人才网seo网站优化流程
  • 开个公司做购物网站历下区百度seo
  • 有什么做任务接单赚钱网站宁波网站推广大全
  • asp.net 网站安装推广目标怎么写
  • 怎样编写app软件seo服务合同
  • 拒绝做网站的理由百度收录最新方法
  • 网站解析后几天可以访问网络域名
  • 潍坊市网站制作seo优化专员招聘
  • 网站免费建站http游戏推广赚佣金平台
  • 网站建设中如何插入动图怎么在百度做广告
  • 百事通做网站seo推广优化官网
  • 用什么软件做网站原型一份完整的营销策划书
  • 蓟县做网站公司最好用的手机优化软件
  • phpcms做网站百度网站收录提交入口全攻略
  • 建设网站的各种问题百度资源分享网页
  • 北京做机柜空调的网站百度seo综合查询
  • 网站的栏目规划搜索引擎营销是什么意思
  • 清洁海绵的网站怎么做宁波营销型网站建设优化建站
  • 网站点击弹出下载框 怎么做的站长检测工具
  • 网站搜索不出来百度排名查询
  • 沛县可以做网站的单位西安网站建设维护
  • 电商网站建设多少钱百度推广价格表