MOOONI's blog

By MOOONI, history, 2 years ago, In English

hey everyone. I have literally NO IDEA why this code gives me runtime error. It looks a little bit messy but pls help. thx in advance.

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

»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Because you used the Segment Tree, you need to make the array $$$4$$$ times bigger($$$200000 \to 800000$$$ or more).

»
2 years ago, # |
  Vote: I like it -17 Vote: I do not like it

You probably messed something up with your segment tree, hence i'll flex my submission here.

  • »
    »
    2 years ago, # ^ |
      Vote: I like it +11 Vote: I do not like it

    I just looked at the editorial — it's the same exact thing. Turns out I was worthless.

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

Check the following simple ordered-map based solution to this problem.

Accepted