QOJ.ac

QOJ

Límite de tiempo: 3.5 s Límite de memoria: 256 MB Puntuación total: 100

#11553. Teiler

Estadísticas

Gegeben ist eine Folge von $n$ ganzen Zahlen $a_1, a_2, \ldots, a_n$. Bestimme die Anzahl der geordneten Paare $(i, j)$, für die $i, j \in \{1, \ldots, n\}$ und $i \ne j$ gelten und $a_i$ ein Teiler von $a_j$ ist.

Eingabe

Die erste Eingabezeile enthält eine ganze Zahl $n$ ($1 \le n \le 2\,000\,000$). Die zweite Zeile enthält eine Folge von $n$ ganzen Zahlen $a_1, a_2, \ldots, a_n$ ($1 \le a_i \le 2\,000\,000$).

Ausgabe

Die erste und einzige Ausgabezeile soll eine ganze Zahl enthalten, die die Anzahl der gesuchten Paare angibt.

Beispiele

Eingabe 1

5
2 4 5 2 6

Ausgabe 1

6

Hinweis

Es gibt 6 Paare mit den angegebenen Eigenschaften: $(1, 2)$, $(1, 4)$, $(1, 5)$, $(4, 1)$, $(4, 2)$, $(4, 5)$.

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.