QOJ.ac

QOJ

Limite de temps : 2.0 s Limite de mémoire : 1024 MB Points totaux : 100 Hackable ✓

#8980. 素数游戏

Statistiques

给定一个包含 $n$ 个整数的序列 $a_i$。

令 $\text{mul}(l, r) = \prod_{i=l}^r a_i$,并令 $\text{fac}(l, r)$ 为 $\text{mul}(l, r)$ 的不同质因数个数。

请计算 $\sum_{i=1}^n \sum_{j=i}^n \text{fac}(i, j)$。

输入格式

第一行包含一个整数 $n$ ($1 \le n \le 10^6$),表示序列的长度。

第二行包含 $n$ 个整数 $a_i$ ($1 \le i \le n, 1 \le a_i \le 10^6$),表示该序列。

输出格式

输出方程的计算结果。

样例

样例输入 1

10
99 62 10 47 53 9 83 33 15 24

样例输出 1

248

样例输入 2

10
6 7 5 5 4 9 9 1 8 12

样例输出 2

134

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.