#441. 求逆序对
求逆序对
Background
Special for beginners, ^_^
Description
给定一个序列 ,如果存在 ,那么我们称之为逆序对,求 中逆序对的数目。
Format
Input
第一行为 ,表示序列长度,接下来的 行,第 行表示序列中的第 个数。
Output
中逆序对的数目。
Samples
4
3
2
3
2
3
Limitation
1s, 1024KiB for each test case.
。
Special for beginners, ^_^
给定一个序列 a1,a2,…,an,如果存在 i<j,ai>aj,那么我们称之为逆序对,求 a 中逆序对的数目。
第一行为 n,表示序列长度,接下来的 n 行,第 i+1 行表示序列中的第 i 个数。
a 中逆序对的数目。
4
3
2
3
2
3
1s, 1024KiB for each test case.
N≤105,Ai≤105。