sum query july cookoff

why am i getting a runtime error ??

problem page:-http://www.codechef.com/problems/RRSUM/

my solution:-http://www.codechef.com/viewsolution/4598396

N <= 10^9 . You can’t have an array of that size.

do you really think array[10^9] will work?

because n can be 10^9 atmost

try to solve problem another way…hint:mathematically :smiley:

2 Likes

thnx man for pointing it to mathematicis :slight_smile: