Блог пользователя Mr.ink

Автор Mr.ink, 10 лет назад, По-английски

I am trying to solv eproblem 442C I see other's code like http://codeforces.com/contest/442/submission/6971106 but i couldn't understand the logic of their code.I also read editorial of problem http://codeforces.com/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.

  • Проголосовать: нравится
  • +6
  • Проголосовать: не нравится

»
10 лет назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

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 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

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