CF1225D.Power Products
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given n positive integers a1,…,an , and an integer k≥2 . Count the number of pairs i,j such that 1≤i<j≤n , and there exists an integer x such that ai⋅aj=xk .
输入格式
The first line contains two integers n and k ( 2≤n≤105 , 2≤k≤100 ).
The second line contains n integers a1,…,an ( 1≤ai≤105 ).
输出格式
Print a single integer — the number of suitable pairs.
输入输出样例
输入#1
6 3 1 3 9 8 24 1
输出#1
5
说明/提示
In the sample case, the suitable pairs are:
- a1⋅a4=8=23 ;
- a1⋅a6=1=13 ;
- a2⋅a3=27=33 ;
- a3⋅a5=216=63 ;
- a4⋅a6=8=23 .