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

建议使用的浏览器:

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

5382:GCD?LCM!

题目描述
First we define:
(1) $lcm(a,b)$, the least common multiple of two integers $a$ and $b$, is the smallest positive integer that is divisible by both $a$ and $b$. for example, $lcm(2,3)=6$ and $lcm(4,6)=12$.
(2) $gcd(a,b)$, the greatest common divisor of two integers $a$ and $b$, is the largest positive integer that divides both $a$ and $b$ without a remainder, $gcd(2,3)=1$ and $gcd(4,6)=2$.
(3) $[exp]$, $exp$ is a logical expression, if the result of $exp$ is $true$, then $[exp]=1$, else $[exp]=0$. for example, $[1+2\geq 3]=1$ and $[1+2\geq 4]=0$.

Now Stilwell wants to calculate such a problem:
$$F(n)=\sum_{i=1}^n\sum_{j=1}^n~[~lcm(i,j)+gcd(i,j)\geq n~] \\
S(n)=\sum_{i=1}^nF(i)$$
Find $S(n)~mod~258280327$.
输入解释
The first line of the input contains a single number $T$, the number of test cases.
Next $T$ lines, each line contains a positive integer $n$.
$T\leq 10^5$, $n\leq 10^6$.
输出解释
$T$ lines, find $S(n)~mod~258280327$.
输入样例
8
1
2
3
4
10
100
233
11037
输出样例
1
5
13
26
289
296582
3928449
213582482
来自杭电HDUOJ的附加信息
Author SXYZ
Recommend wange2014

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

源链接: HDU-5382

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

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 131072/131072K(Java/Others)