Logo
(追記) (追記ここまで)

15616번 - Divisors 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB103593852.055%

문제

You are given a sequence of n integers a1, a2, ..., an. You should determine the number of such ordered pairs (i, j), that i, j ∈ {1, ..., n}, i ≠ j and ai is a divisor of aj.

입력

The first line of input contains one integer n (1 ≤ n ≤ 2,000,000). The second line contains a sequence of n integers a1, a2, ..., an (1 ≤ ai ≤ 2,000,000).

출력

In the first and only line of output should contain one integer, denoting the number of pairs sought.

제한

예제 입력 1

5
2 4 5 2 6

예제 출력 1

6

힌트

There are 6 pars with the specified properties: (1, 2), (1, 4), (1, 5), (4, 1), (4, 2), (4, 5).

출처

ICPC > Regionals > Europe > Central European Regional Contest > Poland Collegiate Programming Contest > AMPPZ 2014 D번

Contest > Open Cup > 2014/2015 Season > Stage 3: Grand Prix of Central Europe D번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /