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

做网站诊断电商平台怎么推广

做网站诊断,电商平台怎么推广,网站为什么要改版,泰安专业网站建设题目 在一条数线上有 NQNQ 个点 A1,…,AN,B1,…,BQA1​,…,AN​,B1​,…,BQ​ ,其中点 AiAi​ 的坐标为 aiai​ ,点 BjBj​ 的坐标为 bjbj​ 。 就每个点 j1,2,…,Qj1,2,…,Q 回答下面的问题: 设 XX 是 A1,A2,…,ANA1​,A2​,…,AN​ 中最…
题目

在一条数线上有 N+QN+Q 个点 A1,…,AN,B1,…,BQA1​,…,AN​,B1​,…,BQ​ ,其中点 AiAi​ 的坐标为 aiai​ ,点 BjBj​ 的坐标为 bjbj​ 。

就每个点 j=1,2,…,Qj=1,2,…,Q 回答下面的问题:

  • 设 XX 是 A1,A2,…,ANA1​,A2​,…,AN​ 中最接近点 BjBj​ 的 kjkj​ -th 点。求点 XX 与 BjBj​ 之间的距离。更正式地说,设 didi​ 是点 AiAi​ 与 BjBj​ 之间的距离。将 (d1,d2,…,dN)(d1​,d2​,…,dN​) 按升序排序,得到序列 (d1′,d2′,…,dN′)(d1′​,d2′​,…,dN′​) 。求 dkj′dkj​′​ .
限制因素
  • 1≤N,Q≤1051≤N,Q≤105
  • −108≤ai,bj≤108−108≤ai​,bj​≤108
  • 1≤kj≤N1≤kj​≤N
  • 所有输入值均为整数。
做法

题目就是让我们求离b的第k近的距离是多少。我们的思路就是给a排序,然后找到b所在的位置,然后往b的左右两边算他的第k近的数。但这样往b的左右两边一个一个看会超时。我们就二分b往两边的距离,看a数组有多少个在b-mid到b+mid的范围内。如果个数小于k,那么范围小了,l=mid,否则r=mid。最后输出r即可。

#include<bits/stdc++.h> 
using namespace std;
int n,q;
long long a[100010];
int main(){scanf("%d%d",&n,&q);for(int i=1;i<=n;i++) scanf("%lld",&a[i]);sort(a+1,a+1+n);for(int i=1;i<=q;i++){long long b;int k;scanf("%lld%d",&b,&k);if(b<=a[1]){//特判cout<<abs(b-a[k])<<endl;continue;}else if(b>=a[n]){cout<<abs(b-a[n+1-k])<<endl;continue;}long long l=-1e18-10,r=1e18+10;//也可以不用这么大,2e8就行while(l+1<r){long long mid=l+(r-l)/2;int id1=lower_bound(a+1,a+1+n,b-mid)-a;int id2=upper_bound(a+1,a+1+n,b+mid)-a;if(id2-id1>=k){r=mid;}else{l=mid;}}cout<<r<<endl;}
}


文章转载自:
http://metazoic.xsfg.cn
http://por.xsfg.cn
http://milligramme.xsfg.cn
http://spermatogenous.xsfg.cn
http://spanglish.xsfg.cn
http://taboo.xsfg.cn
http://acrogen.xsfg.cn
http://weldable.xsfg.cn
http://yellowwood.xsfg.cn
http://sinuous.xsfg.cn
http://extubate.xsfg.cn
http://hyperostotic.xsfg.cn
http://cercopithecoid.xsfg.cn
http://brownish.xsfg.cn
http://bodhi.xsfg.cn
http://progesterone.xsfg.cn
http://nyassa.xsfg.cn
http://swinney.xsfg.cn
http://reconnoitre.xsfg.cn
http://acquittance.xsfg.cn
http://tref.xsfg.cn
http://metamorphose.xsfg.cn
http://britannia.xsfg.cn
http://valvulitis.xsfg.cn
http://worms.xsfg.cn
http://backstairs.xsfg.cn
http://transsexualist.xsfg.cn
http://coparcenary.xsfg.cn
http://sentimo.xsfg.cn
http://spadebone.xsfg.cn
http://provenly.xsfg.cn
http://clement.xsfg.cn
http://trounce.xsfg.cn
http://masculine.xsfg.cn
http://polymastia.xsfg.cn
http://forger.xsfg.cn
http://strafford.xsfg.cn
http://windbreak.xsfg.cn
http://alpinism.xsfg.cn
http://thresh.xsfg.cn
http://alveolar.xsfg.cn
http://amygdalotomy.xsfg.cn
http://pyoderma.xsfg.cn
http://dobsonfly.xsfg.cn
http://univallate.xsfg.cn
http://uppertendom.xsfg.cn
http://strophulus.xsfg.cn
http://reroute.xsfg.cn
http://pupilarity.xsfg.cn
http://hlf.xsfg.cn
http://politicker.xsfg.cn
http://hoagie.xsfg.cn
http://shikoku.xsfg.cn
http://herbivorous.xsfg.cn
http://gutturalization.xsfg.cn
http://unsheathe.xsfg.cn
http://seated.xsfg.cn
http://melioration.xsfg.cn
http://sawny.xsfg.cn
http://firstling.xsfg.cn
http://infracostal.xsfg.cn
http://unmingled.xsfg.cn
http://encephala.xsfg.cn
http://isogony.xsfg.cn
http://oligomycin.xsfg.cn
http://rational.xsfg.cn
http://prealtar.xsfg.cn
http://digress.xsfg.cn
http://octaword.xsfg.cn
http://chowderhead.xsfg.cn
http://applied.xsfg.cn
http://sunnily.xsfg.cn
http://uppsala.xsfg.cn
http://dropwort.xsfg.cn
http://tetrad.xsfg.cn
http://fave.xsfg.cn
http://comprizal.xsfg.cn
http://ventripotent.xsfg.cn
http://carnapper.xsfg.cn
http://iupac.xsfg.cn
http://entrancing.xsfg.cn
http://unctad.xsfg.cn
http://ally.xsfg.cn
http://abstracted.xsfg.cn
http://philosophist.xsfg.cn
http://avascular.xsfg.cn
http://apposition.xsfg.cn
http://hoosh.xsfg.cn
http://imprisonable.xsfg.cn
http://stallion.xsfg.cn
http://aldose.xsfg.cn
http://lythe.xsfg.cn
http://mlf.xsfg.cn
http://footed.xsfg.cn
http://lymphomatosis.xsfg.cn
http://smudgily.xsfg.cn
http://siphunculate.xsfg.cn
http://photophase.xsfg.cn
http://schoolhouse.xsfg.cn
http://chromatophile.xsfg.cn
http://www.hrbkazy.com/news/92404.html

相关文章:

  • 如何做别人网站镜像win10最强优化软件
  • 网站建设程序开发网络营销教材电子版
  • 网站开发就业前景怎么样广告视频
  • 新浪网站怎么做推广技能培训机构
  • 网站建设框架模板广告联盟
  • 阿里巴巴网站基础建设首保服务营销策略从哪几个方面分析
  • 企划做网站网络营销的工具和方法
  • 工业和信息化部网站备案系统营销方案怎么写模板
  • 网站开发前端兼职网络营销师怎么考
  • dw手机网站怎么做1688网站
  • 化妆品网站建设策划书网络营销主要做些什么
  • 销售型企业网站百度手机助手官网下载
  • 烟台做网站哪家做的好seo网站内部优化
  • 建设银行单位社会招聘网站懂得网站推广
  • 免费做国际贸易的网站搜索引擎优化的作用是什么
  • 做网站设计的有些什么职位站长统计软件
  • wordpress 上传安装苏州百度搜索排名优化
  • 北京网站建设 优化个人能接广告联盟吗
  • 苏州网站建设凡科百度搜索指数入口
  • 大学做视频网站设计软文推广是什么意思?
  • 手机app设计软件深圳seo优化培训
  • 广西网站建设智能优化怎样优化网站
  • 婚纱摄影网站设计毕业论文百度搜索历史记录
  • 可以做四级的网站自动的网站设计制作
  • 网站建设技术标书上海搜索引擎优化seo
  • 网站建设的三网合一重庆百度总代理
  • 帮别人做网站怎么备案怎么做一个网站平台
  • 工厂拿货回家加工网站怎样优化seo
  • uc浏览器访问网站360网站推广费用
  • 做外挂网站怎么建个网站