Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @Harry.B,validated by @DavidAugustoVilla,@JesusR and @ManuelJ.
If you have any issues, feel free to ping them.
Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @Harry.B,validated by @DavidAugustoVilla,@JesusR and @ManuelJ.
If you have any issues, feel free to ping them.
From the description, I did not immediately understand that the gold only replenishes for the first turn after selection (i.e. if it is not selected again, the gold in that pile will be unchanged). Also, when it is selected for a second time, it replenishes to (rate%) of its currently reduced value (not of the original value). The example is not sufficient to distinguish these possibilities, but I eventually worked it out from the second test.
Finally, the validators did not provide an example where there were fewer than 3 bins. My code incorrectly handled this case, and passed all of the validators. Fixing the bug allowed me to pass Test 3, which had previously failed.
I’ve altered the statement slightly to hopefully help make it more clear what’s required.
True that there were no visible case with 2 bins so have altered the test case accordingly.
time limit for C++ is set too low, I translated my solution from C++ to Python and it passed perfectly