#abc342d. D - Square Pair
D - Square Pair
Score: points
问题描述
给定一个长度为 的非负整数序列 。找出满足以下两个条件的整数对 的数量:
- 是一个完全平方数。
这里,若非负整数 可以表示为某个非负整数 的平方形式,即 ,则称 为完全平方数。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given a sequence of non-negative integers of length . Find the number of pairs of integers that satisfy both of the following conditions:
- is a square number.
Here, a non-negative integer is called a square number when it can be expressed as using some non-negative integer .
Constraints
- All inputs are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
5
0 3 2 8 12
Sample Output 1
6
Six pairs of integers, , satisfy the conditions.
For example, , and is a square number, so the pair satisfies the conditions.
Sample Input 2
8
2 2 4 6 3 100 100 25
Sample Output 2
7
update @ 2024/3/10 01:36:20