It's UWAweek 49

help3001

This forum is provided to promote discussion amongst students enrolled in CITS3001 Advanced Algorithms.

Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

How do I ask a good question?
Displaying selected article
Showing 1 of 202 articles.
Currently 4 other people reading this forum.


 UWA week 38 (2nd semester, week 8) ↓
SVG not supported

Login to reply

👍?
helpful
12:29pm Wed 18th Sep, Andrew G.

"Mahit Gupta" <23*9*2*5@s*u*e*t*u*a*e*u*a*> wrote:
> The way I thought of solving this problem was similar to the hints, take all the potions if the remaining hp after the potion is less than a sword. If it isn't skip the potion and take a sword. This doesn't seem to work as in some cases, taking lesser damage in the start is actually benificial. > I don't understand how to interpret this in a greedy way, when to decide if taking a lower hit is better than a higher, I assumed taking a higher hit would always be better in the start and then take a lower one. > > 50 1 1 2 > 30 > 20 > That strategy doesn't seem to work as we would rather have a hit of just 15 in the beginning to get to 15 than to get a hit of 20 and then just get to 21
I encourage you to have a think about this question, which may help you figure out/understand the solution: If we somehow knew the set of potions and swords we would be using, does the order you use them matter?

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy