SPOJ - Inversion Count

Find the number of inversions of A.