shivanshsingh9670's blog

By shivanshsingh9670, history, 18 months ago, In English

Question

Submission

I did this question by Segment tree but my solution is throwing TLE. I I think the TC is O(n logn) for larger cases. So I think it should work this way but it is failing. Is it not possible to further optimize it doing this way ?

  • Vote: I like it
  • +3
  • Vote: I do not like it

| Write comment?
»
18 months ago, # |
  Vote: I like it +3 Vote: I do not like it

well the segment tree is O(nlg)

but in program it takes the high coefficient cause this you got TLE

try to code better and don't get it :)