| Baozii Cup 2 |
|---|
| Finished |
Baozii Cup problems have always been known for their succinct problem statements. This one is no exception.
You are given an array $$$a$$$ of length $$$n$$$. Count the number of quadruplets of integers $$$(i,j,k,l)$$$ that satisfy the following conditions:
The first line of each test contains an integer $$$n$$$ ($$$1 \le n \le 10^5$$$) — the length of $$$a$$$.
The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ ($$$1 \le a_i \le n$$$) — the elements of $$$a$$$.
Output the number of quadruplets of integers satisfying the conditions on a single line.
61 1 4 5 1 4
2
71 1 2 1 2 2 1
6
| Name |
|---|


