Submit solution
Points:
10 (partial)
Time limit:
1.0s
Memory limit:
32M
Author:
Problem type
Allowed languages
Python
Problem Statement
Given a list , please determine the number of inverse pairs in , where an inverse pair is defined as and .
Input Specification
The first line of the input gives the number of test cases, , test cases follow.
Each test case consists of a line.
The line contains the elements in ,seperated by a space.
Limits
Memory limits: 32MB.
Time limits: 1 second.
, where
Test Set 1
Sample Case
Test Set 2
Test Set 3
Test Set 4
Output Specification
For each test case, output one line containing Case #x: y
, where is the case number(starting from 1) and is the
number of inverse pairs in .
Sample Input
3
1 2 3 4
2 5 4 3
5 5 1 1
Sample Output
Case #1: 0
Case #2: 3
Case #3: 4
Hint
loop
if-else
Comments