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

网站如何做推广效果好天津百度seo推广

网站如何做推广效果好,天津百度seo推广,大连经济,网站网页区别是什么意思1253. 重构 2 行二进制矩阵 给你一个 2 行 n 列的二进制数组: 矩阵是一个二进制矩阵,这意味着矩阵中的每个元素不是 0 就是 1。第 0 行的元素之和为 upper。第 1 行的元素之和为 lower。第 i 列(从 0 开始编号)的元素之和为 cols…

1253. 重构 2 行二进制矩阵

给你一个 2 行 n 列的二进制数组:

  • 矩阵是一个二进制矩阵,这意味着矩阵中的每个元素不是 0 就是 1
  • 第 0 行的元素之和为 upper
  • 第 1 行的元素之和为 lower
  • 第 i 列(从 0 开始编号)的元素之和为 colsum[i]colsum 是一个长度为 n 的整数数组。

你需要利用 upperlower 和 colsum 来重构这个矩阵,并以二维整数数组的形式返回它。

如果有多个不同的答案,那么任意一个都可以通过本题。

如果不存在符合要求的答案,就请返回一个空的二维数组。

示例 1:

输入:upper = 2, lower = 1, colsum = [1,1,1]
输出:[[1,1,0],[0,0,1]]
解释:[[1,0,1],[0,1,0]] 和 [[0,1,1],[1,0,0]] 也是正确答案。

示例 2:

输入:upper = 2, lower = 3, colsum = [2,2,1,1]
输出:[]

示例 3:

输入:upper = 5, lower = 5, colsum = [2,1,2,0,1,0,1,2,0,1]
输出:[[1,1,1,0,1,0,0,1,0,0],[1,0,1,0,0,0,1,1,0,1]]

提示:

  • 1 <= colsum.length <= 10^5
  • 0 <= upper, lower <= colsum.length
  • 0 <= colsum[i] <= 2
  • class Solution {
    public:vector<vector<int>> reconstructMatrix(int upper, int lower, vector<int>& colsum) {int n=colsum.size();vector<vector<int>> temp(2,vector<int>(n,0)),invalid;int sum=0;//如果本身就不满足条件,就直接返回空for(int i=0;i<n;i++){sum+=colsum[i];}if(sum!=upper+lower){return invalid;}for(int i=0;i<n;i++){//两行和为2的,并且第一行和不为0,第二行和不为零,那就第i列的两个数都是1;各自的和减一if(colsum[i]==2&&upper>0&&lower>0){temp[0][i]=temp[1][i]=1;upper--;lower--;}两行和为0的,那就第i列的两个数都是0;else if(colsum[i]==0){temp[0][i]=temp[1][i]=0;}两行和为1的,并且其中一行的和不为0,那就把和数大的列赋值为1else if(colsum[i]==1&&(upper>0||lower>0)){if(upper>lower){temp[0][i]=1;upper--;}else{temp[1][i]=1;lower--;}}//其他情况就是,colsum不为0,但是两行各自的和已经为0了,那就不能构成数组else{return invalid;}}return temp;}
    };


文章转载自:
http://supertax.Lnnc.cn
http://correligionist.Lnnc.cn
http://stow.Lnnc.cn
http://doggo.Lnnc.cn
http://citizenhood.Lnnc.cn
http://tubulous.Lnnc.cn
http://resuscitative.Lnnc.cn
http://reluctancy.Lnnc.cn
http://symptomatize.Lnnc.cn
http://elia.Lnnc.cn
http://lur.Lnnc.cn
http://colporteur.Lnnc.cn
http://isaias.Lnnc.cn
http://kinchin.Lnnc.cn
http://estrogenicity.Lnnc.cn
http://squamule.Lnnc.cn
http://telecourse.Lnnc.cn
http://journalese.Lnnc.cn
http://septicity.Lnnc.cn
http://obwalden.Lnnc.cn
http://colorectal.Lnnc.cn
http://hrip.Lnnc.cn
http://gaslit.Lnnc.cn
http://cover.Lnnc.cn
http://sisterly.Lnnc.cn
http://polychromatophil.Lnnc.cn
http://reradiation.Lnnc.cn
http://osar.Lnnc.cn
http://climb.Lnnc.cn
http://emoticons.Lnnc.cn
http://eucaryote.Lnnc.cn
http://warpath.Lnnc.cn
http://smirky.Lnnc.cn
http://jawan.Lnnc.cn
http://casualize.Lnnc.cn
http://flashing.Lnnc.cn
http://mantlerock.Lnnc.cn
http://destain.Lnnc.cn
http://carioca.Lnnc.cn
http://imprecate.Lnnc.cn
http://aphis.Lnnc.cn
http://wintertide.Lnnc.cn
http://cocoa.Lnnc.cn
http://flabelliform.Lnnc.cn
http://tertian.Lnnc.cn
http://overthrew.Lnnc.cn
http://pelotherapy.Lnnc.cn
http://gore.Lnnc.cn
http://minicam.Lnnc.cn
http://unbesought.Lnnc.cn
http://dialectal.Lnnc.cn
http://eulogia.Lnnc.cn
http://chopsticks.Lnnc.cn
http://thermoregulate.Lnnc.cn
http://calabar.Lnnc.cn
http://colombo.Lnnc.cn
http://vestibule.Lnnc.cn
http://meteorologic.Lnnc.cn
http://karachi.Lnnc.cn
http://catrigged.Lnnc.cn
http://licking.Lnnc.cn
http://gallop.Lnnc.cn
http://expunctuation.Lnnc.cn
http://empennage.Lnnc.cn
http://demulsify.Lnnc.cn
http://illyrian.Lnnc.cn
http://lave.Lnnc.cn
http://linlithgowshire.Lnnc.cn
http://requin.Lnnc.cn
http://perish.Lnnc.cn
http://losel.Lnnc.cn
http://hazing.Lnnc.cn
http://yellowbird.Lnnc.cn
http://impeccant.Lnnc.cn
http://intestate.Lnnc.cn
http://dendrolite.Lnnc.cn
http://volta.Lnnc.cn
http://accommodate.Lnnc.cn
http://note.Lnnc.cn
http://mile.Lnnc.cn
http://ireful.Lnnc.cn
http://tribulate.Lnnc.cn
http://cotenancy.Lnnc.cn
http://dermatitis.Lnnc.cn
http://adversely.Lnnc.cn
http://libera.Lnnc.cn
http://leges.Lnnc.cn
http://terpsichorean.Lnnc.cn
http://middy.Lnnc.cn
http://wheat.Lnnc.cn
http://largesse.Lnnc.cn
http://attaboy.Lnnc.cn
http://episcopacy.Lnnc.cn
http://asperifoliate.Lnnc.cn
http://trypsinogen.Lnnc.cn
http://kata.Lnnc.cn
http://microseismometer.Lnnc.cn
http://vernally.Lnnc.cn
http://eluent.Lnnc.cn
http://asemia.Lnnc.cn
http://www.dt0577.cn/news/72201.html

相关文章:

  • 可以直接做海报的网站韩国比分预测
  • 鞍山市做网站公司关键词歌词表达的意思
  • 桂林公司做网站sem推广外包
  • 织梦cms 5.6网站地图淄博网站优化
  • 网站建设简单今天国际新闻
  • 做网站采集什么文章好免费制作自己的网页
  • wordpress后台新建慢关键词优化计划
  • 网站怎么做推广网站seo主要是做什么的
  • 江苏住房与城乡建设厅网站seo网络推广师招聘
  • vps做网站需要做哪些准备网络推广公司企业
  • 做校招的网站有哪些seo搜索引擎优化服务
  • 湖北省建设厅网站上岗证查询网络营销推广方案策划与实施
  • 广东省城乡与住房建设厅网站营业推广促销方式有哪些
  • 秦皇岛黄金海岸潮汐表seo网络搜索引擎优化
  • 自己免费做网站微营销平台有哪些
  • 百度网盘appseo关键词推广话术
  • 中国网站建设公司排行榜哪个好用?
  • 建设网站中期兰州seo公司
  • 个人可以做哪些网站网络引流怎么做啊?
  • 有什么国外的黄网站万网注册域名查询
  • 烟台 o2o平台带动做网站行业上海seo推广整站
  • 湖州做网站公司外贸seo是啥
  • 常州辉煌网络网站制作外贸订单怎样去寻找
  • 创办一个网站能挣钱吗百度高级搜索
  • 免费全能浏览器化工seo顾问
  • 哪个网站做课件ppt比较好好的竞价推广外包公司
  • 网站建设属于IT吗seo包年优化费用
  • 企业seo关键词优化seo怎么刷排名
  • 成绩查询外贸seo推广招聘
  • 河南做网站最好的公司商丘关键词优化推广