题意:给一个序列A,要求构造序列B,使得 Bi <= Ai, gcd(Bi) > 1, 1 <= i <= n, 输出构造的方法数. 析:首先这个题直接暴力是不可能解决的,可以先找出最大值mmax和最小值mmin,然后枚举每个gcd,也就是最大公约数d,那么其他数就应该是d 2*d 3*d 4*d ....如果把每个数的个数求出来.那么答案就是每一种 d 的数量的和,每一种的数量就是 a1 * a2 * a3 ... an,其中是 ai 是 第 i 个数所能取到 d 的数量. 这样…
2017 多校2 hdu 6053 TrickGCD 题目: You are given an array \(A\) , and Zhu wants to know there are how many different array \(B\) satisfy the following conditions? \(1≤B_i≤A_i\) For each pair(\(l , r) (1≤l≤r≤n) , gcd(bl,bl+1...br)≥2\) Input The first line…
Mophues Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 327670/327670 K (Java/Others) Total Submission(s): 980 Accepted Submission(s): 376 Problem Description As we know, any positive integer C ( C >= 2 ) can be written as the multiply of…
Code Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 300 Accepted Submission(s): 124 Problem Description WLD likes playing with codes.One day he is writing a function.Howerver,his computer b…