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

建议使用的浏览器:

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

6134:Battlestation Operational

题目描述
> The Death Star, known officially as the DS-1 Orbital Battle Station, also known as the Death Star I, the First Death Star, Project Stardust internally, and simply the Ultimate Weapon in early development stages, was a moon-sized, deep-space mobile battle station constructed by the Galactic Empire. Designed to fire a single planet-destroying superlaser powered by massive kyber crystals, it was the pet project of the Emperor, Darth Vader, and its eventual commander Grand Moff Wilhuff Tarkin to expound the military philosophy of the aptly named Tarkin Doctrine.
>
> — Wookieepedia

In the story of the Rogue One, the rebels risked their lives stolen the construction plan of the Death Star before it can cause catastrophic damage to the rebel base. According to the documents, the main weapon of the Death Star, the Superlaser, emits asymmetric energy in the battlefield that cause photons to annihilate and burns everything in a single shot.

You are assigned the task to estimate the damage of one shot of the Superlaser.

Assuming that the battlefield is an $n\times n$ grid. The energy field ignited by the Superlaser is asymmetric over the grid. For the cell at $i$-th row and $j$-th column, $\lceil i/j \rceil$ units of damage will be caused. Furthermore, due to the quantum effects, the energies in a cell cancel out if $\gcd (i,j) \neq 1$ or $i \lt j$.

The figure below illustrates the damage caused to each cell for $n=100$. A cell in black indicates that this cell will not be damaged due to the quantum effects. Otherwise, different colors denote different units of damages.

Your should calculate the total damage to the battlefield. Formally, you should compute
$$
f(n)=\sum_{i=1}^{n}\sum_{j=1}^{i} \left\lceil \frac{i}{j} \right\rceil \left[ (i, j) = 1\right],
$$

where $[(i,j)=1]$ evaluates to be $1$ if $\gcd(i,j)=1$, otherwise $0$.
输入解释
There are multiple test cases.

Each line of the input, there is an integer $n$ ($1\le n \le 10^6$), as described in the problem.

There are up to $10^4$ test cases.
输出解释
For each test case, output one integer in one line denoting the total damage of the Superlaser, $f(n)\ mod\ 10^9+7$.
输入样例
1 
2
3
10
输出样例
1
3
8
110
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-6134

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

共提交 0

通过率 --%
时间上限 内存上限
6000/3000MS(Java/Others) 65536/65536K(Java/Others)