当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6969:I love triples

题目描述
Now Mr.I has an array $a$ consisting of $n$ integers.

He now wants to know how many triples $(i, j, k)$ satisfy $i<j<k$ and $a_i * a_j * a_k$ is a square number .

The definition of a square number is a number that can be expressed as the product of two identical integers.

For example, 1, 4, 9, 16, 25, and 36 are square numbers, but 2, 3, and 6 are not.
输入解释
The first line contains an integer $T(T\leq 6)$ . Then $T$ test cases follow.

Each test case contains two lines.

The first one contains an integer $n(1\leq n\leq {10}^5)$ — length of the array $a$.

The second one contains $n$ integers $a_1,a_2,...,a_n(1\leq a_i\leq {10}^5)$
输出解释
For each test case, output a single line containing a single integer — the number of triples that meet the conditions.
输入样例
1
6
1 2 4 8 16 32
输出样例
10

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6969

最后修改于 2021-10-23T19:10:52+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
3000/1500MS(Java/Others) 262144/262144K(Java/Others)