goextreme's blog

By goextreme, history, 13 months ago, In English

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

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

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
13 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

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.