Segmentation fault-Inversion count

here is my code https://ide.codingblocks.com/s/229064
what is wrong with my code- also do i have to mention the topic or is it provided to the TAs

@sshreya2912
Your code is giving segmentation fault because size of your temp array is very large. You can’t create that much big array. Simply reduce the size of temp to temp[100005]. All testcase will pass.
Also you don’t have to mention the topic, it is provided to us once you raise the doubt.

now that its been a while there was this question over codechef asking for basically the same code https://www.codechef.com/LRNDSA04/problems/EURON and here is my code to it idk I keep getting WA https://ide.codingblocks.com/s/229257

@sshreya2912
maximum ans possible is (n*(n-1))/2 which can’t be stored in int. Use long long int everywhere. I just submitted your code with this change and it works.

thankyou very much it helped