标签:
Source : SCU Programming Contest 2006 Final | |||
Time limit : 1 sec | Memory limit : 64 M |
Submitted : 1598, Accepted : 432
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.
InputThe first line is an integer N (N <= 50000). The second line contains N integer(s): A1, A2, ..., An(0 <= Ai <= 32768).
OutputThere is only one number, which is the the number of different collocation.
Sample Input5 1 2 3 4 1Sample Output
6
标签:
原文地址:http://www.cnblogs.com/a972290869/p/4256822.html