Mr.ink's blog

By Mr.ink, 10 years ago, In English

I am trying to solv eproblem 442C I see other's code like http://codeforces.net/contest/442/submission/6971106 but i couldn't understand the logic of their code.I also read editorial of problem http://codeforces.net/blog/entry/12739
but i can not understand how it handle situations like 1 100 101 200 when the minimum is in the elements that we can not remove.

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

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

answer for 1 100 101 200 is equal to the answer of (0 99 100 199) + 2 so if the minimum is first or last remove it and make the answer += minimun*(n-2) and subtract the numbers see my code :D 6926204

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

    Thanks for your explanation.I think it could be down without subtracting ?