QOJ.ac

QOJ

حد الوقت: 1 s حد الذاكرة: 16 MB مجموع النقاط: 10

#11672. 和

الإحصائيات

Marcin 的班级明天就要进行一场非常重要的数学测验!Marcin 的同学们通过某种手段得知,测验中唯一需要做的事情就是计算以下和:

$$S_n = d(1) + d(2) + \dots + d(n)$$

对于不同的 $n$ 值,其中 $d(i)$ 表示数字 $i$ 的约数个数。遗憾的是,同学们忘记告诉 Marcin 测验中具体会出现哪些 $n$ 值。由于 Marcin(尤其是他的父母)非常看重这次数学成绩,Marcin 决定带一台掌上电脑去考场,通过自动化计算来确保拿到高分,即使测验中出现非常大的 $n$ 值也不怕。可惜 Marcin 不会编程,所以他请求你的帮助。你的程序能帮他拿到高分吗?

编写一个程序,完成以下任务:

  • 读取数字 $n$;
  • 计算和 $S_n$ 的值;
  • 输出结果。

输入的第一行也是唯一一行包含一个整数 $n$ ($1 \le n \le 10^{12}$)。

输出的第一行也是唯一一行应包含一个整数,即和 $S_n$ 的值。请记住,Marcin 的成绩取决于你程序的正确性!

样例

输入格式 1

5

输出格式 1

10

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.