I want to calculate the number of inversions for a very big array, something like 200,000 ints, and the number I get is quite big. So big it can't be stored in an int
value.
The answer I get is something like -8,353,514,212, while for simple cases it works, so I think that the problem is the type of the variable I use to store the number of inversions.
I also tried with long int
and the output is the same, but if I try with double
4.0755e+009 is the output. I don't know what the problem is.