I am using BIT in code,which gives me TLE.

can anyone suggest a faster solution involving BIT for DRANGE.


problem: http://www.codechef.com/problems/DRANGE

my code: http://www.codechef.com/viewsolution/4894812

hello anshkhanna7,

I would like to tell you that there is no need of advanced data structure like BIT. If you have noticed that you need to first process all the operation and then report the answer. This is the only observation that you need to solve this problem. I strictly recommend you to have a look on the editorial for this problem.

Anything that you want to ask further please do comment.

1 Like

it came across my mind to use BIT.i did not think of doing anything else.
thanks anyway,i will think of another approach to this problem.

but just wanted to ask can we get it accepted using BIT?

1 Like

Look at this solution i have just got AC with my approach and first attempt was TLE then i need to use fast I/O . u can imagine yourself that the time limit for this problem is intendly kept so strict so that no other solution can pass the test data.

thanks ma5termind

hmm :smiley: my pleasure

if you really want to use your bit then are some problems for you

happy coding bye :smiley:

thanks!! :smiley: