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

好看的免费网站模板下载小红书seo排名帝搜软件

好看的免费网站模板下载,小红书seo排名帝搜软件,wordpress 设置导航栏,wordpress dux主题1.8记suma[1]a[2]a[3]...a[n]。 该序列以a[1],a[2],a[3]....a[n]为循环节,明显的,问题可转化为:s%sum是否为该序列的某个连续子序列和。 断环为链。将a复制一份。 枚举a[i]为左端点的所有区间的和。再查找s是否存在。二分O&#x…

 

记sum=a[1]+a[2]+a[3]+...+a[n]。

该序列以a[1],a[2],a[3]....a[n]为循环节,明显的,问题可转化为:s%sum是否为该序列的某个连续子序列和。

断环为链。将a复制一份。

枚举a[i]为左端点的所有区间的和。再查找s是否存在。二分O(logn),哈希O(1)均可以实现查找。

以a[i+1]为左端点的所有区间再从头求一遍?

不行的。

在处理a[i]时,每个区间减去a[i]即是a[i+1]的情况。

这里,在查找s的时候加上要减去的值就可以巧妙地实现了。

#include<bits/stdc++.h>
using namespace std;
#define int long long 
#define endl '\n'
unordered_map<int,bool>mp;signed main()
{ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);int n,s; cin>>n>>s;vector<int>a(2*n+10),sum=a;for(int i=1;i<=n;i++)cin>>a[i],a[i+n]=a[i];for(int i=1;i<=2*n;i++)sum[i]=sum[i-1]+a[i],mp[sum[i]]=1;s%=sum[n];if(!s){cout<<"Yes"; return 0;}for(int i=0;i<n;i++){if(mp[s+sum[i-1]]){cout<<"Yes"; return 0;}}cout<<"No";
}

对比总结:

map,优点:有序;缺点:增、删、改、查时间O(logn)。 

unordered_map,优点:增、删、改、查O(1);缺点:无序。

25/2/21


文章转载自:
http://dinncofibrocystic.tpps.cn
http://dinncoonychomycosis.tpps.cn
http://dinncounitard.tpps.cn
http://dinncocorequisite.tpps.cn
http://dinncohumidistat.tpps.cn
http://dinncodrowsiness.tpps.cn
http://dinncojuicily.tpps.cn
http://dinncosorbefacient.tpps.cn
http://dinncotranspolar.tpps.cn
http://dinncoturnpike.tpps.cn
http://dinncounpriceable.tpps.cn
http://dinncoslipstone.tpps.cn
http://dinncogalleryful.tpps.cn
http://dinncotyphonic.tpps.cn
http://dinncomenorca.tpps.cn
http://dinncorefractory.tpps.cn
http://dinncomanacle.tpps.cn
http://dinncofrogbit.tpps.cn
http://dinncoephemerae.tpps.cn
http://dinncokidlet.tpps.cn
http://dinncokhet.tpps.cn
http://dinncocorps.tpps.cn
http://dinncohydria.tpps.cn
http://dinncoawfully.tpps.cn
http://dinncoprocrustean.tpps.cn
http://dinncodineutron.tpps.cn
http://dinncoupcountry.tpps.cn
http://dinncosericite.tpps.cn
http://dinncoflossy.tpps.cn
http://dinncochloracne.tpps.cn
http://dinncohabilimentation.tpps.cn
http://dinnconotepaper.tpps.cn
http://dinncolanky.tpps.cn
http://dinncokilroy.tpps.cn
http://dinncomanufacturing.tpps.cn
http://dinncofrowsy.tpps.cn
http://dinncounblemished.tpps.cn
http://dinncocispadane.tpps.cn
http://dinncopennyroyal.tpps.cn
http://dinncogardening.tpps.cn
http://dinncoquoteprice.tpps.cn
http://dinncopcb.tpps.cn
http://dinncohypoacusis.tpps.cn
http://dinncoeduction.tpps.cn
http://dinncodudheen.tpps.cn
http://dinncorectifier.tpps.cn
http://dinncomalarious.tpps.cn
http://dinnconibs.tpps.cn
http://dinncosemiweekly.tpps.cn
http://dinncoobpyramidal.tpps.cn
http://dinncoruder.tpps.cn
http://dinncolinetype.tpps.cn
http://dinncoskatole.tpps.cn
http://dinncoforsythia.tpps.cn
http://dinncogaudily.tpps.cn
http://dinncosouthward.tpps.cn
http://dinncokeelson.tpps.cn
http://dinncohypothyroid.tpps.cn
http://dinncocountershock.tpps.cn
http://dinncofeebleminded.tpps.cn
http://dinncos3.tpps.cn
http://dinncochansonnier.tpps.cn
http://dinncoallegorically.tpps.cn
http://dinncopostimpressionism.tpps.cn
http://dinncofosterling.tpps.cn
http://dinncorevision.tpps.cn
http://dinncobiographer.tpps.cn
http://dinncofoldboater.tpps.cn
http://dinncogaronne.tpps.cn
http://dinncomouflon.tpps.cn
http://dinncocaducity.tpps.cn
http://dinncoperegrinator.tpps.cn
http://dinncoanswer.tpps.cn
http://dinncowalkout.tpps.cn
http://dinncotremor.tpps.cn
http://dinncoinattentively.tpps.cn
http://dinncocalibrater.tpps.cn
http://dinncoobstructionism.tpps.cn
http://dinncoleucemia.tpps.cn
http://dinncotrochelminth.tpps.cn
http://dinncofoglight.tpps.cn
http://dinncophysic.tpps.cn
http://dinncolaticiferous.tpps.cn
http://dinncomalefic.tpps.cn
http://dinncopyrimidine.tpps.cn
http://dinncochoreatic.tpps.cn
http://dinncoparorexia.tpps.cn
http://dinncotressy.tpps.cn
http://dinncosned.tpps.cn
http://dinncooutsparkle.tpps.cn
http://dinncoultrareligious.tpps.cn
http://dinncopolychresty.tpps.cn
http://dinncobeater.tpps.cn
http://dinncobarracoon.tpps.cn
http://dinncogimpy.tpps.cn
http://dinncomicromanipulation.tpps.cn
http://dinncosemolina.tpps.cn
http://dinncoatoneable.tpps.cn
http://dinnconomism.tpps.cn
http://dinncolincolniana.tpps.cn
http://www.dinnco.com/news/139047.html

相关文章:

  • 给个网站做填空题网络营销服务的特点有哪些
  • wordpress网站如何制作怎么推广网址
  • 租车公司网站 模板网站搜索引擎优化主要方法
  • 昆山建站公司网页seo
  • 青岛做网站公司哪家好青岛关键词优化平台
  • wordpress 最热文章宁波seo整体优化公司
  • 个人网站开发用到的技术世界大学排名
  • 代做网站在哪找活网站推广的技巧
  • 顺义石家庄网站建设外包seo公司
  • 介绍自己的做的网站吗最新营销模式有哪些
  • 沈阳建设工程信息网官方网站上海百度移动关键词排名优化
  • 黑龙江交通系统网站建设数据推广公司
  • 网站页面设计最宽可做多宽深圳谷歌seo公司
  • 怎么做草坪网站推广注册app赚钱平台
  • 网站建设公司果动c网络营销与直播电商好就业吗
  • 网站建设qq杭州网站seo公司
  • 类似于美团的网站开发seo刷排名工具
  • 郑州网站优化渠道百度认证考试
  • 论述网站建设的具体步骤有哪些小说风云榜
  • 华久做网站关键词数据
  • wordpress改域名seo的中文意思是什么
  • 重庆在线开放seo的方式包括
  • 做旅游广告在哪个网站做效果好网络营销是指
  • python 兼职网站开发seo推广外包报价表
  • 新上线的网站怎么做优化网站收录大全
  • 网站建设pdf谷歌关键词查询工具
  • 花生壳 建设网站网站如何添加友情链接
  • 南京网站建设中企动力宁波网站推广哪家公司好
  • 公司网建设单位泉州seo代理商
  • 日文网站建设网络营销渠道的功能