#abc206cL. 习题11.3.6 交换(Swappable)
习题11.3.6 交换(Swappable)
Score : points
Problem Statement
Given an array of integers , find the number of pairs of integers satisfying all of the following conditions:
Constraints
-
All values in input are integers.
-
-
Input
Input is given from Standard Input in the following format:
Output
Print the answer as an integer.
Sample Input 1
3
1 7 1
Sample Output 1
2
In this input, we have .
-
For the pair , .
-
For the pair , .
-
For the pair , .
Sample Input 2
10
1 10 100 1000 10000 100000 1000000 10000000 100000000 1000000000
Sample Output 2
45
Sample Input 3
20
7 8 1 1 4 9 9 6 8 2 4 1 1 9 5 5 5 3 6 4
Sample Output 3
173