singh1495's blog

By singh1495, history, 6 years ago, In English

can anyone tell me why my code gives tle and hows i can remove this i apply mo algo correctly for this than why this gives me tle http://codeforces.com/contest/703/submission/19736475 thanx in advance

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

»
6 years ago, # |
  Vote: I like it +1 Vote: I do not like it

It gives tle because MO's algorithm is not the intended solution for this problem. The number of queries is very large. This problem can be solved using segment trees or BIT.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    thanx alot for telling me this point i solve it using another approach