Skip to main content
7 events
when toggle format what by license comment
May 24, 2015 at 2:52 comment added Andrew Thank you! This answer worked great since I couldn't answer it in time, and I mostly understand it...looking forward to my algorithms class to understand this kind of stuff better.
May 21, 2015 at 2:32 comment added inyoot I add an example code in the answer for you @Andrew
May 21, 2015 at 2:31 history edited inyoot CC BY-SA 3.0
add python code as an example
May 21, 2015 at 0:30 comment added Andrew If you don't mind, can you write some example code? I'm afraid I still don't understand.
May 20, 2015 at 21:55 comment added inyoot @Andrew you can find maximum number of food needed and minimum number of food needed by using only two loops (N^2) instead of listing all possible paths. If amount of food Beta Rabbit is less than minimum number of food then return -1 else backtrack maximum path and modify it until equal or less than Betta Rabbit food amount.
May 20, 2015 at 19:36 comment added Andrew Hmm, I'm not sure how this would work. If I'm always taking the maximum of those two, then it seems like the food would go down to critical levels quite quickly, and I'll be stuck far from the goal corner with not enough food to continue. Or, if I'm not understanding you, then what's the meaning of your solution? How do I determine the food left from those numbers?
May 20, 2015 at 19:27 history answered inyoot CC BY-SA 3.0