当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5153:A card problem

题目描述
JayYe is solving a card problem. His IQ is low recently, so he ask you for help.
In a room, there are $N$ tables numbered $1,2,3,…,N$. There is a blue card on each table. The ith card is on the ith table. On the ith blue card, there is a number $A_{i}$. Now you can put on a red card on each table and the number on the ith red card is $B_{i}(1\leq B_{i}\leq A_{i})$. Then a problem comes, for one arrangement how many pair of $(i,j)$ that satisfy $i < j$ and $ gcd(B_{i},B_{j})$ has at most one different prime factor? We call these pairs $good pairs$. For example, 12 has two different prime factors. $(12=2*2*3)$
But this is not you problem. You can easily know there are $\prod\limits_{i=1}^{N}A_{i}$ different arrangements. Your task is to calculate the sum of the number of $good pairs$ of all different arrangements. As the answer can be rather large, find remainder after dividing the number by $1000000007({10}^{9}+7)$.
输入解释
There are several test cases.
In each test case:
The first line contains a integer $N(1\leq N\leq 100000)$. The second line contains $N$ integers $A_{1},A_{2},A_{3},...A_{N}(1\leq A_{i}\leq 100000,1\leq i\leq N)$.
输出解释
For each test case, output the remainder of division of the resulting number by $1000000007({10}^{9}+7)$.
输入样例
2
2 5
2
10 10
输出样例
10
98
提示
In the first test case, there are 10 different arrangements:
{1,1} {1,2} {1,3} {1,4} {1,5} {2,1} {2,2} {2,3} {2,4} {2,5}.
All pairs are good, so answer is 10.
来自杭电HDUOJ的附加信息
Recommend heyang

该题目是Virtual Judge题目,来自 杭电HDUOJ

题目来源 BestCoder Round #24

源链接: HDU-5153

最后修改于 2020-10-25T23:20:15+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
5000/2500MS(Java/Others) 32768/32768K(Java/Others)