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

Автор goextreme, история, 14 месяцев назад, По-английски

Hi everyone. I was solving problem https://mirror.codeforces.com/contest/1759/problem/E and my solution is this: https://mirror.codeforces.com/contest/1759/submission/228398584

but unfortunately i failed test 3. can you help me to clarify which part of my submission is wrong

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

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

In your solution you always try to use 2 green serums before blue + green, which is not always optimal. Consider the following testcase:

1
3 4
12 25 83

Your solution outputs 2, while the answer is 3, because you can multiply strength by 6, then eat 12 and 25, resulting in strength 42, then multiply by 2, and eat 83.