Getting WA on Counting Inversion Problem

Revision en1, by xuanquang1999, 2015-08-24 16:45:58

I'm having trouble at this problem on Vietnam SPOJ. The problem is: Given array a[1], a[2], ... a[n], count the number of pair (u, v) that u < v and a[u] > a[v]. Constrain: n <= 60000 and a[i] <= 60000.

I tried to this using Fenwick Tree. But I'm getting only 60 points (maximum points is 100). Is there anything wrong in my implementation?

Here's my code.

#### History

Revisions

Rev. Lang. By When Δ Comment
en1 xuanquang1999 2015-08-24 16:45:58 480 Initial revision (published)