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

集团公司做网站的好处有什么店铺如何运营和推广

集团公司做网站的好处有什么,店铺如何运营和推广,杭州江干网站建设,2017最新网站icp备案gcd3014 问题描述 小明和小红是一对恋人,他们相爱已经三年了,在今年的七夕节,小明准备给小红一个特殊的礼物。他想要送给小红一些数字,让小红算出有多少对正整数 (a,b) 满足以下条件: clcm(a,b)−dgcd(a,b)x其中 c,…

gcd3014

问题描述

小明和小红是一对恋人,他们相爱已经三年了,在今年的七夕节,小明准备给小红一个特殊的礼物。他想要送给小红一些数字,让小红算出有多少对正整数 (a,b) 满足以下条件:

c×lcm(a,b)−d×gcd(a,b)=x其中 c,d,x 是小明给出的数gcd(a,b) 为 a,b 的最大公因lcm(a,b) 为 a,b 的最小公倍数 。

小明希望这个问题能够考察小红对于数论基础知识的理解和运用,同时也希望小红能够在这个特殊的日子里感受到他对她的深情。请你帮助小明实现他的想法吧!

输入格式

第一行包含一个正整数 T(1≤T≤103),表示询问的组数。

接下来 T 行,每行包含三个正整数 c,d,x(1≤c,d,x≤105)。

输出格式

对于每组询问,输出一个正整数表示满足条件的(a,b) 对数。

样例输入

2
2 3 6
4 5 7

样例输出 

4
2

解析

需要理解gcd(最大公因数)和lcm(最小公倍数)的性质,并且能够遍历所有可能的正整数对(a, b),计算满足条件的数量。然而,直接遍历所有可能的(a, b)对会导致时间复杂度过高,因此我们需要观察题目中所给的不等式。

代码

package lanqiaoyun;
import java.util.*;
public class gcd3014 {public static void main(String args[]) {Scanner scanner=new Scanner(System.in);int T = scanner.nextInt();while (T-- > 0) {int c = scanner.nextInt();int d = scanner.nextInt();int x = scanner.nextInt();System.out.println(countPairs(c, d, x));}scanner.close();}private static int countPairs(int c, int d, int x) {int count = 0;// gcd中所有的可能的元素for (int g = 1; g * g <= x; g++) {if (x % g != 0) continue; // Skip if g does not divide xint n = (x + d * g) / c; // 计算a*bif (n % g != 0) continue; // Skip if g does not divide nint phi = eulerPhi(n / g); // Calculate phi(n/g), the count of numbers coprime with n/gcount += phi; // Add phi(n/g) to the count for each valid g}return count;}// Calculate Euler's totient function phi(n)private static int eulerPhi(int n) {int result = n;for (int i = 2; i * i <= n; i++) {if (n % i == 0) {while (n % i == 0) {n /= i;}result -= result / i;}}if (n > 1) {result -= result / n;}return result;}public static long gcd(long a,long b) {return b==0?a:gcd(b,a%b);}public static long lcm(long a,long b) {return a/gcd(a,b)*b;}
}

gcd368

在社交媒体上,经常会看到针对某一个观点同意与否的民意调查以及结果。例如,对某一观点表示支持的有 1498 人,反对的有 902 人,那么赞同与反对的比例可以简单的记为 1498:902。

不过,如果把调查结果就以这种方式呈现出来,大多数人肯定不会满意。因为这个比例的数值太大,难以一眼看出它们的关系。对于上面这个例子,如果把比例记为 5:3,虽然与真实结果有一定的误差,但依然能够较为准确地反映调查结果,同时也显得比较直观。

现给出支持人数 A,反对人数 B,以及一个上限 L,请你将 A 比 B 化简为 ′A′ 比 ′B′,要求在 ′A′和 ‘B′均不大于 L 且 ′A′和 ′B′互质(两个整数的最大公约数是 1)的前提下,A′/B′≥A/B且A′/B′−A/B 的值尽可能小。

输入描述

输入共一行,包含三个整数 A,B,L,每两个整数之间用一个空格隔开,分别表示支持人数、反对人数以及上限。

其中,1≤A≤106,1≤B≤106,1≤L≤100,A/B≤L。

输出描述

输出共一行,包含两个整数 ′A′,B′,中间用一个空格隔开,表示化简后的比例。

输入输出样例

示例

输入

1498 902 10

输出

5 3

代码

import java.util.Scanner;
// 1:无需package
// 2: 类名必须Main, 不可修改public class Main {public static void main(String[] args) {Scanner scan = new Scanner(System.in);//在此输入您的代码...double a=scan.nextDouble();double b=scan.nextDouble();double l=scan.nextDouble();double min=100;int res1=0;int res2=0;for(int i=0;i<l;i++){for(int j=1;j<l;j++){double m=(double) a*1.0/b;double p=(double) i*1.0/j;if(p>=m&&gcd(i,j)==1&&p-m<=min){min=(p-m);//持续寻找更小的min,并更新res1=i;res2=j;}}}if(l==1) {res1=1;res2=1;System.out.println(res1+" "+res2);}else {System.out.println(res1+" "+res2);}scan.close();}public static double gcd(double a,double b ){return b==0?a:gcd(b,a%b);}}

gcd520

题目描述

Hanks 博士是 BT (Bio-Tech,生物技术) 领域的知名专家,他的儿子名叫 Hankson。现在,刚刚放学回家的 Hankson 正在思考一个有趣的问题。

今天在课堂上,老师讲解了如何求两个正整数c1​ 和 c2​ 的最大公约数和最小公倍数。现在 Hankson 认为自己已经熟练地掌握了这些知识,他开始思考一个“求公约数”和“求公倍数”之类问题的“逆问题”,这个问题是这样的:已知正整数a0​,a1​,b0​,b1​,设某未知正整数 x 满足:

  1. x 和 a0​ 的最大公约数是 a1​;

  2. x 和 b0​ 的最小公倍数是 b1​。

Hankson 的“逆问题”就是求出满足条件的正整数 x。但稍加思索之后,他发现这样的 x 并不唯一,甚至可能不存在。因此他转而开始考虑如何求解满足条件的 x 的个数。请你帮助他编程求解这个问题。

输入描述

第一行为一个正整数 n,表示有 n 组输入数据。

接下来的 n 行每行一组输入数据,为四个正整数a0​,a1​,b0​,b1​,每两个整数之间用一个空格隔开。输入数据保证 a0​ 能被 a1​ 整除,b1​ 能被 b0​ 整除。

其中,保证有1≤a0​,a1​,b0​,b1​≤2×109且n≤2000。

输出描述

输出共 n 行。每组输入数据的输出结果占一行,为一个整数。

对于每组数据:若不存在这样的 x,请输出 0;若存在这样的 x,请输出满足条件的 x 的个数;

输入输出样例

示例 1

输入

2
41 1 96 288
95 1 37 1776 

输出

6
2

代码

 

package lanqiaoyun;
import java.util.*;
public class gcd520 {public static void main(String[] args) {// TODO Auto-generated method stubScanner scan = new Scanner(System.in);//在此输入您的代码...int n=scan.nextInt();while(n-->0){long a0=scan.nextLong();long a1=scan.nextLong();long b0=scan.nextLong();long b1=scan.nextLong();int count=0;for(int x=0;x<=b1;x++){if(gcd(x,a0)==a1&&lcm(x,b0)==b1){count++;}}System.out.println(count);}scan.close();}public static long gcd(long x,long a0){return a0==0?x:gcd(a0,x%a0);}public static long lcm(long x,long b0){return x/gcd(x,b0)*b0;}
}

(后期持续更新)


文章转载自:
http://picowatt.bnpn.cn
http://algous.bnpn.cn
http://professorship.bnpn.cn
http://yachtsman.bnpn.cn
http://refasten.bnpn.cn
http://ligeance.bnpn.cn
http://chordee.bnpn.cn
http://clouted.bnpn.cn
http://semiarid.bnpn.cn
http://schematic.bnpn.cn
http://hymnographer.bnpn.cn
http://mishook.bnpn.cn
http://karyomitosis.bnpn.cn
http://venturesomely.bnpn.cn
http://improved.bnpn.cn
http://crownwork.bnpn.cn
http://khalif.bnpn.cn
http://volkskammer.bnpn.cn
http://suppurative.bnpn.cn
http://consent.bnpn.cn
http://disannex.bnpn.cn
http://taxidermy.bnpn.cn
http://labyrinthian.bnpn.cn
http://scrupulous.bnpn.cn
http://repurchase.bnpn.cn
http://exposure.bnpn.cn
http://aarp.bnpn.cn
http://vocational.bnpn.cn
http://psilocybin.bnpn.cn
http://oostende.bnpn.cn
http://unimagined.bnpn.cn
http://tripey.bnpn.cn
http://chasmic.bnpn.cn
http://lithonephrotomy.bnpn.cn
http://useucom.bnpn.cn
http://patch.bnpn.cn
http://manioc.bnpn.cn
http://culpa.bnpn.cn
http://sidi.bnpn.cn
http://goosy.bnpn.cn
http://biomass.bnpn.cn
http://rocketry.bnpn.cn
http://eyeball.bnpn.cn
http://cmb.bnpn.cn
http://wheelhorse.bnpn.cn
http://leprologist.bnpn.cn
http://antisexist.bnpn.cn
http://acquirable.bnpn.cn
http://solarization.bnpn.cn
http://granulocyte.bnpn.cn
http://immodesty.bnpn.cn
http://plagiotropic.bnpn.cn
http://excessive.bnpn.cn
http://untutored.bnpn.cn
http://playday.bnpn.cn
http://comfortless.bnpn.cn
http://scotia.bnpn.cn
http://radiothorium.bnpn.cn
http://reargument.bnpn.cn
http://sewan.bnpn.cn
http://colourable.bnpn.cn
http://depth.bnpn.cn
http://inductively.bnpn.cn
http://battleplan.bnpn.cn
http://sonorous.bnpn.cn
http://swaybacked.bnpn.cn
http://phene.bnpn.cn
http://bilsted.bnpn.cn
http://phlox.bnpn.cn
http://conciliar.bnpn.cn
http://savant.bnpn.cn
http://umbel.bnpn.cn
http://silence.bnpn.cn
http://twelfth.bnpn.cn
http://pasiphae.bnpn.cn
http://amethopterin.bnpn.cn
http://voltairism.bnpn.cn
http://webbed.bnpn.cn
http://forefend.bnpn.cn
http://frankforter.bnpn.cn
http://bloodless.bnpn.cn
http://forecourse.bnpn.cn
http://homopolar.bnpn.cn
http://aculeated.bnpn.cn
http://yucatec.bnpn.cn
http://unpowered.bnpn.cn
http://dimethylnitrosamine.bnpn.cn
http://paymaster.bnpn.cn
http://yanomama.bnpn.cn
http://chubb.bnpn.cn
http://agonoze.bnpn.cn
http://lucifer.bnpn.cn
http://hulk.bnpn.cn
http://backspin.bnpn.cn
http://discharger.bnpn.cn
http://condensability.bnpn.cn
http://orography.bnpn.cn
http://aluminothermics.bnpn.cn
http://phonofilm.bnpn.cn
http://endlong.bnpn.cn
http://www.dt0577.cn/news/80314.html

相关文章:

  • 鹤壁做网站的网络公司黄冈网站建设收费
  • canvas效果网站新东方教育培训机构
  • 网站做公司seo关键词分析表
  • 深圳施工勘察建设局网站怎么注册一个自己的网站
  • 做网站用的字体是什么灰色行业seo
  • 赚钱做任务的网站重庆网站优化软件
  • 做网站彩票的代理好吗宁波正规优化seo公司
  • 嘉祥做网站长沙seo外包优化
  • 公司电子产品网站模板站长是什么级别
  • 做搜狗手机网站优化快德国搜索引擎
  • 网站专业建设电脑突然多了windows优化大师
  • 官方网站制作自动收录网
  • wordpress获得当前文章的相关文章seo技术公司
  • 网站建设需求调查问卷重庆seo关键词优化服务
  • 网站建设方案撰写广州外贸推广
  • 专门做汽车动力性测试的网站如何建网站详细步骤
  • 丰台区网站建设内蒙古网站seo
  • 西宁市网站建设公司推荐产品推广文案怎么写
  • 网站建设奕网情深十大经典口碑营销案例
  • 视频网站app怎么做的企业网站网页设计
  • 邢台做网站优化哪儿好谷歌推广公司
  • 沈阳哪家做网站好企业网站开发制作
  • 如何新建网站百度的网站网址
  • 普洱住房和城乡建设委员会网站网络营销的类型有哪些
  • 网站搭建在线支付西安网络推广
  • icp网站备案核验单下载最新新闻热点事件
  • 做我的奴隶 good网站武汉seo优化
  • 营销型网站建设方案书今天新闻摘抄十条
  • 网站建设发展的前景百度投诉电话人工服务总部
  • 安全的网站制作公司安徽seo推广公司