#F. [省选联考 2021 B 卷] 数对

    Type: RemoteJudge 1000ms 512MiB

[省选联考 2021 B 卷] 数对

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) 满足 1in1 \le i \le n1jn1 \le j \le niji \ne jaia_iaja_j 的倍数。

输入格式

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

输出格式

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

6
16 11 6 1 9 11

7

见附件中的 pair/pair2.in。
见附件中的 pair/pair2.ans。

提示

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

2024暑假C23toB大黄鸭争夺赛

Not Attended
Status
Done
Rule
Ledo
Problem
6
Start at
2024-7-20 14:00
End at
2024-7-20 16:30
Duration
2.5 hour(s)
Host
Partic.
50