B. Division Sum

    提交答案题

Division Sum

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

Background

This is an output-only problem. You may compute the answer by writing a program or by hand, and then submit the answer text directly.

Description

Xiao Ming wrote the following piece of code while preparing for ACM:

n = 1000000000000000000 # 1e18
ans = 0
for i in range(1, n + 1):
    ans = ans + n // i
print(ans)

He waited and waited, but the program never finished. Please help him — directly output the value that this program would print.

In other words, compute:

$$S = \sum_{i=1}^{10^{18}} \left\lfloor \frac{10^{18}}{i} \right\rfloor $$

Format

Only a single number. The output of the brute force code.

Samples

The example is for illustration of the format only; it may be incorrect.

5201314

Hello ACM 2026 环境测试

未参加
状态
已结束
规则
ACM/ICPC
题目
2
开始于
2026-8-13 13:00
结束于
2026-8-13 15:00
持续时间
2 小时
主持人
参赛人数
18