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

32793번 - GCD Pairs 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
5 초 2048 MB131251919.000%

문제

In the Shape Galaxy, where all shapes are sentient beings, there is currently a feud between circles and squares. Circles want all pathways to be flat while squares argue that they should be evenly spaced inverted catenary shaped bumps. Because of this feud, circles have begun to dislike all square-biased numbers. A number $s$ is square-biased if it is divisible by $x^2,ドル for some integer $x > 1$.

Mr. Circle has taken this feud to heart. He is given the assignment of calculating the greatest common divisor between all pairs of numbers in an array. He wants to go one step further and count the number of greatest common divisors that are not square biased.

입력

The first line of input contains a single integer, $n$ $(1 \le n \le 10^5),ドル representing the length of the array of numbers.

The next $n$ lines contain the integers $a_i$ $(1 \le a_i \le 10^{12})$ which comprise the numbers in the array.

출력

Output a single integer, the number of pairs $(i, j)$ $(1 \le i < j \le n)$ such that $\gcd(a_i, a_j)$ is not square-biased.

제한

예제 입력 1

6
3
4
6
12
4
1

예제 출력 1

12

힌트

출처

ICPC > Regionals > North America > Pacific Northwest Regional > 2024 ICPC Pacific Northwest Regional > Division 1 G번

  • 문제를 만든 사람: Jerry Li
(追記) (追記ここまで)

출처

대학교 대회

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

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