atcoder#ABC252D. [ABC252D] Distinct Trio
[ABC252D] Distinct Trio
Score : points
Problem Statement
You are given a sequence of length : . Find the number of triples that satisfy both of the following conditions.
- , , and are distinct.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
4
3 1 4 1
2
The two triples satisfying the conditions are and .
10
99999 99998 99997 99996 99995 99994 99993 99992 99991 99990
120
15
3 1 4 1 5 9 2 6 5 3 5 8 9 7 9
355