Wrong answers in all cases

where am i wrong in the code

@singh.vishen09
Line 24-27
You forgot to update inversion count here
You need to add to sum here also
Also move tmp[100000] outside the function and make it global variable to avoid TLE

If your doubt is resolved please close it

since we are taking care of all count in this loop what is the need to update the count there?
while(i<=mid && j<=e)
{
if(a[i]<=a[j])
{
temp[k++]=a[i++];
}
else
{
temp[k++]=a[j++];
count+=mid-i+1;
}
}

@singh.vishen09
I apologise buddy
I mis-understood the question
You are right
Issue is with line 33
for(int i=s;i<=e;i++) {
It should be i<=e not i<e