You are given an array aa consisting of nn integers. Your task is to say the number of such positive integers xx such that xx divides eachnumber from the array. In other words, you have to find the number of common divisors of all elements in the arr…
Common Divisors time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given an array aa consisting of nn integers. Your task is to say the number of such positive integers xx such that x…
B Equal Rectangles 题意: 给你4*n个数,让你判断能不能用这个4*n个数为边凑成n个矩形,使的每个矩形面积相等 题解: 原本是想着用二分来找出来那个最终的面积,但是仔细想一想,那个面积只能是给出的4*n个数中的最小值和最大值的乘积,如果这两个长度不凑成一个矩形,那么肯定全部矩形的面积会出现不一致的 代码: 1 //The idea was to use dichotomies to find that area, and then use that area to figur…
一.题目描述 A common divisor for two positive numbers is a number which both numbers are divisible by. It's easy to calculate the greatest common divisor between tow numbers. But your teacher wants to give you a harder task, in this task you have to find…
https://atcoder.jp/contests/abc142/tasks/abc142_d 题意 求满足互素条件下的A和B的因子最多有几个 思路: 分解gcd(A,B)的质因子,再加上1: #include <iostream> #include<algorithm> #include<string> using namespace std; ; long long gcd(long long x,long long y) { )return x; return…