C. 数对

    Type: Default 3000ms 512MiB

数对

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

数对

题目描述

给定 nn 个正整数 aia_i,请你求出有多少个数对 (i,j)(i, j) 满足 1≤i≤n1 \le i \le n,1≤j≤n1 \le j \le n,i≠ji \ne j 且 aia_i 是 aja_j 的倍数。

输入格式

第一行,一个整数 nn,表示数字个数。

第二行,nn 个整数,表示 aia_i。

输出格式

输出一行,一个整数,表示答案。

输入输出样例 #1

输入 #1

6
16 11 6 1 9 11

输出 #1

7

说明/提示

对于 40%40 \% 的数据,n≤1000n \le 1000。
对于 70%70 \% 的数据,1≤ai≤5×1031 \le a_i \le 5 \times {10}^3。
对于 100%100 \% 的数据,2≤n≤2×1052 \le n \le 2 \times {10}^5,1≤ai≤5×1051 \le a_i \le 5 \times {10}^5。

寒假集训线上测试3-普及组

Not Attended
Status
Done
Rule
IOI
Problem
3
Start at
2026-3-1 19:00
End at
2026-3-1 21:00
Duration
2 hour(s)
Host
Partic.
22