Getting Runtime Error

I solved this question using BIT(Fenwick tree )TECHNO3 Problem - CodeChef
My soln :CodeChef: Practical coding for everyone
I don’t understand why i’m getting Runtime.Please Someone help!!