goextreme's blog

By goextreme, history, 8 months ago, In English

Hi everyone. I was solving problem https://codeforces.com/contest/1759/problem/E and my solution is this: https://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

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

»
8 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.

  • »
    »
    8 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    How do u people generate the testcase where the code is failing so quickly??