Help with Code coach Challenge "Roadrunner". | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Help with Code coach Challenge "Roadrunner".

I think I misunderstand the Input values. In the Challenge it's said input 1. Roadrunner and Coyote distance from safety spot 2. Roadrunner Speed 3. Coyote speed. (Everything in feet per sec) Sample Input: 10 5 20 Output: Meep Meep (Output when Roadrunner can escape) Roadrunner reach it in 2 Sec and Coyote is 30 feet away. How's that calculated? Edit: also why's the Coyote with 20 feet per sec slower than 5 feet per sec

10th Jul 2022, 1:25 PM
Felix Alcor
Felix Alcor - avatar
6 Answers
+ 4
Felix Alcor The distance between Coyote and Roadrunner is 50 feet and both are from safety point so if Roadrunner is at 10 feet distance then Coyote distance would be 10 + 50 = 60 2nd input is the speed of Roadrunner 3rd input is the speed of Coyote So now you have to get time so roadrunner time = 10 / 5 = 2.0 coyote time = (10 + 50) / 20 = 3.0 now compare both time and print result.
10th Jul 2022, 1:41 PM
A͢J
A͢J - avatar
+ 2
Felix Alcor Check the first line of the description A coyote is chasing a roadrunner and they start out 50 feet apart. If you know how fast they are both traveling, and how far the roadrunner is from safety, determine whether or not the coyote is able to catch the roadrunner. Both animals and the roadrunner's safe place are on a straight line.
10th Jul 2022, 2:00 PM
A͢J
A͢J - avatar
+ 1
Already found it Out myself 10/5 = 2 sec and (10+50)/20=3sec. I didn't see that they start 50feet apart.
10th Jul 2022, 1:39 PM
Felix Alcor
Felix Alcor - avatar
+ 1
A͢J Thanks I have overflown the description and didn't see the 50feet apart start.
10th Jul 2022, 1:43 PM
Felix Alcor
Felix Alcor - avatar
10th Jul 2022, 2:11 PM
Felix Alcor
Felix Alcor - avatar
0
a = int(input()) b = int(input()) c = int(input()) d = 50 if a/b < (a + d)/c: print("Meep Meep") else: print("Yum")
20th Jul 2023, 4:31 AM
Мартин Симонян