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

建议使用的浏览器:

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

3734:How Many W

题目描述
Given a sequence (S_1, S_2, ..., S_N) (1 <= S_i <= 1,000,000,000, S_i != S_j), count the number of W, which can be regarded as a quintuple (a, b, c, d, e) satisfying a < b < c < d < e, S_b < S_c < S_a, S_d < S_c < S_e.
输入解释
The beginning of the input is an integer T, which is the number of test cases. T cases are followed. The first line of each test case is an integer N (1 <= N <= 100,000), which denotes the length of the sequence. The second line is N integer S_1, S_2, ..., S_N, which denote the sequence.
输出解释
For each test case, print a line contains a single integer which is the number of W, modulo 1,000,000,007.
输入样例
2
5
5 1 3 2 4
6
6 1 3 4 2 5
输出样例
1
3
来自杭电HDUOJ的附加信息
Author God of moe -- GXX
Recommend notonlysuccess

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

题目来源 ACMDIY第二届群赛

源链接: HDU-3734

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

共提交 0

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