princemishra's blog

By princemishra, history, 13 days ago, In English

I am trying to implement KQUERY from spoj using persistent segment tree CodeLink but getting WA.

Please Help!

 
 
 
 
  • Vote: I like it
  • -9
  • Vote: I do not like it

»
12 days ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

The time limit is pretty strict, but try using an implicit segment tree with point updates and range queries. I think I have a pretty understandable implementation here. Hope it helps!

EDIT: I realized this doesn't work on this particular problem, my fault. Good luck in finding the solution though.

»
12 days ago, # |
  Vote: I like it 0 Vote: I do not like it

finally got accepted codeLink just implemented data-structure using vectors.