Блог пользователя SuperMo

Автор SuperMo, история, 5 дней назад, По-английски

Hi in problem B of last contest the answer is ∑(pi−ai)+max(pi−ai) now I don't get the max(pi−ai) part I know what it's but I don't know how did we derive it can someone help ?

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

»
5 дней назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

for adding 1 to the k elements you select need to add k+1 to your score right, so the number of turns of selecting k elements is basically the max element difference , so for each turn u spend 1 extra so the number of turns are max(pi-ai) so hence its max(pi-ai) extra

  • »
    »
    5 дней назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    ok thanks, It clicked after reading the comment for several times the problem is that I did it with a completely different approach so it was hard for me to understand this

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

Maths