当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5147:Sequence II

题目描述
Long long ago, there is a sequence A with length n. All numbers in this sequence is no smaller than 1 and no bigger than n, and all numbers are different in this sequence.
Please calculate how many quad (a,b,c,d) satisfy:
1. $1\leq a < b < c < d \leq n$
2. $A_{a} < A_{b}$
3. $A_{c} < A_{d}$
输入解释
The first line contains a single integer T, indicating the number of test cases.
Each test case begins with a line contains an integer n.
The next line follows n integers $A_{1},A_{2}, \ldots, A_{n}$.

[Technical Specification]
1 <= T <= 100
1 <= n <= 50000
1 <= $A_{i}$ <= n
输出解释
For each case output one line contains a integer,the number of quad.
输入样例
1
5
1 3 2 4 5
输出样例
4
来自杭电HDUOJ的附加信息
Recommend heyang

该题目是Virtual Judge题目,来自 杭电HDUOJ

题目来源 BestCoder Round #23

源链接: HDU-5147

最后修改于 2020-10-25T23:20:12+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
5000/2500MS(Java/Others) 32768/32768K(Java/Others)