Given a number sequence which has N element(s), please calculate the number of different collocation for three number Ai, Aj, Ak, which satisfy that Ai < Aj > Ak and i < j < k.
有给定的一个数组A[i]有N个数,请计算出满足(1):系数i < j < k.(2):Ai < Aj > Ak.请算出有多少种这样的组合的三个数?
Input
The first line is an integer N (N <= 50000). The second line contains N integer(s): A1, A2, ..., An(0 <= Ai <= 32768).
首先输入N,第2行输入N个int,
Output
There is only one number, which is the the number of different collocation.
输出一个NUM,是一共有多少中不同的组合.
Sample Input
5
1 2 3 4 1
例如:
1 2 1
131
234
124
^^^^^^
Sample Output
6
-DFAE -DESS -DDVD -DMTK -DDVR -DDECODE -DMSTAR -DPMP我决定在论坛潜水3年又3年!