OpenJudge - 32:Reverse Pair
32:Reverse Pair
总时间限制:
1000ms
内存限制:
65536kB
描述
Given a sequence S of N numbers. How many pairs of indexes I and J are there satisfying that I is less than J and S[i] is greater than S[J]?
给定有N个数的序列S,有多少对下标I和J,满足I小于J并且S[i]大于S[J]?
输入
First line: one positive integers N (N <= 100).
第一行:一个正整数N(N<=100)。
Second line: N positive integers (<= 1000).
第二行:N个不超过1000的正整数。
输出
One integer.
一个整数。