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

Автор Ludwig_Bonaparte, история, 36 минут назад, По-английски

I've spent some time thinking about this problem, and for the first time of solving many questions i don't get the question itself. I somehow get the basic mechanics of this problem. But i don't know what to solve? what the question is aksing me. this is the question linkMashmokh & Tokens. I looked up at the editorial but then there's magically an assumption of k initial tokens, my thought was if i am given x tokens a day and there's some conversion for it in dollars the greedy approach would be to sell all the tokens to maximize profit, what's wrong with my thinking? ciao

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

»
24 минуты назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

I think the key is to separate the two goals: maximizing the money you receive and keeping as many tokens as possible.

Since you can only exchange tokens at the end of the current day, you don't need to save any tokens for future days. Instead, for each day, you need to find the minimum number of tokens you must return to receive the maximum possible amount of money.

Try to work backwards from the payment formula: which values of w give you the maximum payment, and which of them is the smallest?