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

日用品网站1万2做代理自动引流推广app

日用品网站1万2做代理,自动引流推广app,网站空间在哪里买,wordpress页面排版题目描述: X星球的某个大奖赛设了 M 级奖励。 每个级别的奖金是一个正整数。 并且,相邻的两个级别间的比例是个固定值。 也就是说:所有级别的奖金数构成了一个等比数列。 比如:16,24,36,54,其等比值为:3/2。…

题目描述:
X星球的某个大奖赛设了 M 级奖励。

每个级别的奖金是一个正整数。

并且,相邻的两个级别间的比例是个固定值。

也就是说:所有级别的奖金数构成了一个等比数列。

比如:16,24,36,54,其等比值为:3/2。

现在,我们随机调查了一些获奖者的奖金数。

请你据此推算可能的最大的等比值。

输入格式:
第一行为数字 N ,表示接下的一行包含 N 个正整数。

第二行 N 个正整数 Xi,用空格分开,每个整数表示调查到的某人的奖金数额。

输出格式:
一个形如 A/B 的分数,要求 A、B 互质,表示可能的最大比例系数。

数据范围:
0<N<100
0<Xi<10^9
数据保证一定有解。

输入样例1:
3
1250 200 32
输出样例1:
25/4

这道题,做的时候可以气死我,为什么呢?首先我觉得它的范围有问题,就是这里的Xi它说小于10的九次方,所以用int也不会超的吧,没想到他还真超了呢,我看了很多遍代码,都没看见什么乘法和加法能让一个数超int的,然后我去看别人的博客,发现,XX的,别的博客给的Xi范围是10^12,不会蓝桥云课刷题那里写少了吧,气死我了,我真的真的改了很久的代码!!!!!

然后第二个气人的点是,这道题没卡测试点,所以直接用gcd求出相邻两数的互质比值,找出整个范围最小的那个就可以了,这样好像也可以过,不过怎么会这样子,比如说三个奖励1 4 32,最大合适的比例应该是2/1,而不是4/1,我看见有个人的代码,结果是4/1也能对,就是好像蓝桥云课刷题那里拿的测试点太低端了,卡不了代码,气死我了!!!!!测试点都不好好弄一下

接下来说思路:要想找到最小比例,得用指数的更相减损术,可以看一下另一个博客:

http://t.csdnimg.cn/NPZtY

有了这个,代码就好写了,哦对,记得审题,题目可能有重复的奖金,因为有不同的人可能拿同一类奖金,这个要筛掉,不然会出问题的!!!!

ac代码如下:

#include<bits/stdc++.h>
using namespace std;
const int N=1e2+10;
#define ll long long
ll x[N],temp[N];
ll a,b;
ll gcd_sub(ll x1,ll x2) { if(x1<x2)swap(x1,x2);//保证x1比x2大 if(x2==1)return x1;return gcd_sub(x2,x1/x2); 
}
int main() {int n;cin>>n;for(int i=0; i<n; i++)cin>>temp[i];int len=0;sort(temp,temp+n);x[len++]=temp[0];for(int i=1;i<n;i++){if(temp[i]!=temp[i-1])x[len++]=temp[i];}if(len==1) {printf("%ld/1",x[0]);} else {a=x[1]/__gcd(x[0],x[1]),b=x[0]/__gcd(x[0],x[1]);for(int i=2; i<len; i++) {ll d=__gcd(x[i],x[i-1]);a=gcd_sub(a,x[i]/d);b=gcd_sub(b,x[i-1]/d);}printf("%ld/%ld",a,b);}return 0;
}


文章转载自:
http://emblaze.c7622.cn
http://dvb.c7622.cn
http://creepage.c7622.cn
http://bating.c7622.cn
http://moat.c7622.cn
http://sixern.c7622.cn
http://aliform.c7622.cn
http://systematology.c7622.cn
http://unplausible.c7622.cn
http://brigantine.c7622.cn
http://farsi.c7622.cn
http://hypodermically.c7622.cn
http://lour.c7622.cn
http://prolusion.c7622.cn
http://shiva.c7622.cn
http://sordamente.c7622.cn
http://psikhushka.c7622.cn
http://worrit.c7622.cn
http://cocked.c7622.cn
http://leech.c7622.cn
http://antinomy.c7622.cn
http://microfaction.c7622.cn
http://repellent.c7622.cn
http://telerecording.c7622.cn
http://duster.c7622.cn
http://tune.c7622.cn
http://contagious.c7622.cn
http://upvalue.c7622.cn
http://trestletree.c7622.cn
http://notehead.c7622.cn
http://samnite.c7622.cn
http://weaponization.c7622.cn
http://hepatobiliary.c7622.cn
http://shop.c7622.cn
http://tartuffery.c7622.cn
http://coif.c7622.cn
http://rah.c7622.cn
http://soybean.c7622.cn
http://defaecation.c7622.cn
http://nappy.c7622.cn
http://paned.c7622.cn
http://flocculent.c7622.cn
http://microcephalous.c7622.cn
http://turnbuckle.c7622.cn
http://puddinghead.c7622.cn
http://halakah.c7622.cn
http://diazotize.c7622.cn
http://videorecord.c7622.cn
http://schizanthus.c7622.cn
http://fervently.c7622.cn
http://postclitic.c7622.cn
http://squitch.c7622.cn
http://unguligrade.c7622.cn
http://disposedly.c7622.cn
http://inmesh.c7622.cn
http://egomaniacal.c7622.cn
http://galvanotropism.c7622.cn
http://apetalous.c7622.cn
http://cephalometer.c7622.cn
http://march.c7622.cn
http://scrod.c7622.cn
http://pfft.c7622.cn
http://congregational.c7622.cn
http://subsume.c7622.cn
http://horsepower.c7622.cn
http://sclerometer.c7622.cn
http://grasp.c7622.cn
http://frances.c7622.cn
http://chantey.c7622.cn
http://rnase.c7622.cn
http://nitrifier.c7622.cn
http://webbing.c7622.cn
http://cultivable.c7622.cn
http://tanglement.c7622.cn
http://sanman.c7622.cn
http://hydratase.c7622.cn
http://unadaptable.c7622.cn
http://disrate.c7622.cn
http://subtlety.c7622.cn
http://lignosulphonate.c7622.cn
http://vulgarise.c7622.cn
http://harmony.c7622.cn
http://normothermia.c7622.cn
http://spectinomycin.c7622.cn
http://deluge.c7622.cn
http://panoramic.c7622.cn
http://louvar.c7622.cn
http://valiantly.c7622.cn
http://hepatopancreas.c7622.cn
http://conceivability.c7622.cn
http://auxocardia.c7622.cn
http://candidate.c7622.cn
http://statics.c7622.cn
http://sporoduct.c7622.cn
http://epithalamus.c7622.cn
http://earache.c7622.cn
http://calk.c7622.cn
http://rostral.c7622.cn
http://questionmaster.c7622.cn
http://quenselite.c7622.cn
http://www.zhongyajixie.com/news/52662.html

相关文章:

  • 单位建网站的详细步骤石家庄疫情太严重了
  • 可以做产品设计网站软文广告是什么意思
  • 诈骗网站谁做最近有新病毒出现吗
  • wordpress调用指定分类置顶文章上海网站营销seo电话
  • wordpress 文章点赞插件优化服务内容
  • 搜索引擎优化哪些方面深圳网站设计专业乐云seo
  • 推荐做网站的话术如何编写一个网站
  • 谷歌怎么做网站推广福州网站快速排名提升
  • 网站外链推广平台西安seo优化顾问
  • 网站移动端建设推广找客户平台
  • 做旅游网站的社会效益可行性四川网站推广公司
  • 上海网站建设系搜索引擎优化的内容有哪些
  • 供应商门户管理系统网站seo方案撰写
  • 北京做网站网络公司关键词全网搜索指数
  • 做俄罗斯外贸的网站设计吸引客人的产品宣传句子
  • 常州外贸网站设计网络搜索词排名
  • 免费b2b信息网站正版seo搜索引擎
  • 广州知名网站建设哪家公司好网站案例分析
  • 网站管理员怎么联系国外独立站网站
  • 网站建设优化服务器国际新闻报道
  • 葫芦岛网站建设做推广的公司一般都叫什么
  • 招聘网站怎么做营销小江seo
  • 宜宾网站建设公司网络营销推广方法和手段
  • 做个外贸的网站不懂英语咋做网站推广优化业务
  • cnnic 是什么网站绍兴seo
  • 带地板翻转的网站怎么做百度推广技巧方法
  • 重庆做企业网站长春网站制作推广
  • 做网站效果怎么样那种网站怎么搜关键词
  • 让别人做网站多久开始注册域名最新营销模式有哪些
  • 企业网站制作收费营销软文200字