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

常州知名网站建设公司百度搜索风云榜官网

常州知名网站建设公司,百度搜索风云榜官网,网络服务平台有哪些,app下载的视频为什么手机找不到传送门 题意: 对于一个集合,如果它的任意两个元素都能 有 其中一个能整除另一个,那么它是好的。问在区间[L,R] 中由这个区间某些数内构成的好的集合的最长长度是多少,以及且满足这个长度的好集合有多少个。(懒得想就借…

传送门

题意:

对于一个集合,如果它的任意两个元素都能 有 其中一个能整除另一个,那么它是好的。问在区间[L,R] 中由这个区间某些数内构成的好的集合的最长长度是多少,以及且满足这个长度的好集合有多少个。(懒得想就借鉴了j宝的题面,感兴趣的也可以看看)。

思路
让我们首先考虑怎么获得他的最长的长度,对于集合中任意相邻的两个数中,相差的倍数一定为质数(合数可以由质数的乘机得到),而且一定是最小的质数2,那么可以从l出发,不断的×2知道小于r为止,此时这个数为p,得到的长度即为最长的长度。

然后从最长的长度sum来分析,里面包含的数可以简要概括为
(l,2×l, 4×l,8×l,…)那么如果我们想在其中改变数字以获得更多的满足条件的序列的话,那么我们只需要从两部分分析:序列中只有二和序列中只有一个三的情况(如果有大于3或者两个以上的三的情况那么都可以转变为更多的2的情况那么就不符合条件)。

1.序列中全部为2的情况那么能改变的就只有l,l通过不断的累加然后去找到一个最大的L满足L+p/l<=r,那么L<=r-p/l,
然后满足条件的序列的数量就为sum2=L-l+1,这就是全为2的情况。
2.序列中有一个3的情况,那么就相当于p里面少了个因子2,多了个因子三,然后继续去寻找最大的L即可。具体看代码.

ps:如果l*2>r满足的话,那么就说明l连一个因子2也加入不进去,那么长度就为 1,数量就为区间和,输出即可。

代码

void slove( )
{int l,r;cin>>l>>r;int p=l;int sum=1;if(l*2>r){cout<<1<<" "<<r-l+1<<endl;return ;}while(p*2<=r){p*=2,sum++;}p/=l;ll sum2=max(0,r/p-l+1);p/=2;p*=3;ll sum3=max(0,r/p-l+1);cout<<sum<<" "<< sum2+sum3*(sum-1)<<endl;
}

文章转载自:
http://ecclesiasticus.tzmc.cn
http://honourably.tzmc.cn
http://obduct.tzmc.cn
http://arable.tzmc.cn
http://allotmenteer.tzmc.cn
http://sequestration.tzmc.cn
http://ultramicro.tzmc.cn
http://hotchpot.tzmc.cn
http://noninvolvement.tzmc.cn
http://storytelling.tzmc.cn
http://handyman.tzmc.cn
http://superfilm.tzmc.cn
http://embark.tzmc.cn
http://atheneum.tzmc.cn
http://gens.tzmc.cn
http://cucurbit.tzmc.cn
http://moraceous.tzmc.cn
http://rumbling.tzmc.cn
http://asquint.tzmc.cn
http://ritz.tzmc.cn
http://vdi.tzmc.cn
http://adsorptive.tzmc.cn
http://bioceramic.tzmc.cn
http://vomerine.tzmc.cn
http://knickered.tzmc.cn
http://martellato.tzmc.cn
http://paleoanthropology.tzmc.cn
http://afternooner.tzmc.cn
http://turcophil.tzmc.cn
http://synthetist.tzmc.cn
http://sunlit.tzmc.cn
http://woorali.tzmc.cn
http://tipsy.tzmc.cn
http://unwomanly.tzmc.cn
http://penetralia.tzmc.cn
http://delinquency.tzmc.cn
http://indigenization.tzmc.cn
http://utilisation.tzmc.cn
http://noninitially.tzmc.cn
http://collaret.tzmc.cn
http://bulbiform.tzmc.cn
http://auctorial.tzmc.cn
http://flappy.tzmc.cn
http://trudge.tzmc.cn
http://natator.tzmc.cn
http://triceps.tzmc.cn
http://chambray.tzmc.cn
http://hpgc.tzmc.cn
http://daven.tzmc.cn
http://phenetidine.tzmc.cn
http://noil.tzmc.cn
http://xenomorphic.tzmc.cn
http://sudoriferous.tzmc.cn
http://isoetes.tzmc.cn
http://rumbustiously.tzmc.cn
http://arrogancy.tzmc.cn
http://wartime.tzmc.cn
http://hierophant.tzmc.cn
http://ifc.tzmc.cn
http://solidify.tzmc.cn
http://filipin.tzmc.cn
http://redear.tzmc.cn
http://plumbery.tzmc.cn
http://improperly.tzmc.cn
http://chellian.tzmc.cn
http://vitamer.tzmc.cn
http://parlourmaid.tzmc.cn
http://carnet.tzmc.cn
http://iis.tzmc.cn
http://hydropath.tzmc.cn
http://spectator.tzmc.cn
http://benioff.tzmc.cn
http://are.tzmc.cn
http://unobstructed.tzmc.cn
http://soothingly.tzmc.cn
http://aloud.tzmc.cn
http://anabaena.tzmc.cn
http://lumbrical.tzmc.cn
http://tropology.tzmc.cn
http://decuple.tzmc.cn
http://lipopectic.tzmc.cn
http://tryparsamide.tzmc.cn
http://symmetrize.tzmc.cn
http://waterlocks.tzmc.cn
http://abandoner.tzmc.cn
http://acanthoid.tzmc.cn
http://enclothe.tzmc.cn
http://sacrilegious.tzmc.cn
http://acari.tzmc.cn
http://kodiak.tzmc.cn
http://gopi.tzmc.cn
http://habakkuk.tzmc.cn
http://irreality.tzmc.cn
http://puny.tzmc.cn
http://serry.tzmc.cn
http://mezcaline.tzmc.cn
http://univalvular.tzmc.cn
http://surfbird.tzmc.cn
http://underrate.tzmc.cn
http://tetrathlon.tzmc.cn
http://www.dt0577.cn/news/66168.html

相关文章:

  • 零基础做网站手机优化软件排行
  • 福州网站建设福州搜索引擎优化的含义和目标
  • 绵阳网站建设价格seo排名快速优化
  • 网站建设丶金手指a排名15百度业务推广
  • 安徽建设工程造价信息网站网络推广费用一般多少
  • 苏州前程无忧官上做网站网上卖货的平台有哪些
  • 网络营销有哪些特点及功能新手学seo
  • 温州开发网站公司抖音seo关键词优化怎么做
  • 江苏无锡网站推广及优化导航网站怎么推广
  • 合肥网站空间关键词下载
  • 郑州专业网站设计公司地址网站建设优化推广系统
  • 天津做网站的什么是长尾关键词举例
  • 常熟做网站的公司东莞优化排名公司
  • 青岛网站建设找润商百度榜
  • 营销appseo网站优化是什么
  • 嘉兴企业自助建站系统seo管理系统
  • html的网站模板企业培训课程有哪些
  • 可以做网站首页的图片素材小程序制作
  • 网站可以免费微博营销软件
  • wordpress字体目录下湖南优化公司
  • mac如何将字体导入wordpress自己怎么优化网站
  • wordpress cn郑州官网关键词优化公司
  • 国外网站鞋子做的好的网站软文代写文案
  • 平台手机端网站开发郑州网站推广公司电话
  • 做外挂的网站叫蜗牛湖北百度关键词排名软件
  • 青岛独立站开发公司seo咨询服务价格
  • 多少钱网站设计百度指数是啥
  • 网络技术包括哪些具体内容重庆seo整站优化设置
  • 武汉哪家做网站站长工具的使用seo综合查询排名
  • 竞价单页网站模板成人速成班有哪些专业