-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheasy_04.py
28 lines (22 loc) · 903 Bytes
/
easy_04.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys, math
# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.
R = int(raw_input()) # the length of the road before the gap.
G = int(raw_input()) # the length of the gap.
L = int(raw_input()) # the length of the landing platform.
# game loop
minSpeed = G + 1
while 1:
S = int(raw_input()) # the motorbike's speed.
X = int(raw_input()) # the position on the road of the motorbike.
# Write an action using print
# To debug: print >> sys.stderr, "Debug messages..."
#print "SPEED" # A single line containing one of 4 keywords: SPEED, SLOW, JUMP, WAIT.
if (X >= (R+G)) or (S > minSpeed): # isOnPlattform or isTooFast
print "SLOW"
elif (X+S) >= (R+G): # canReachPlattform then jump
print "JUMP"
elif S < minSpeed: # mustSpeedUp
print "SPEED"
else:
print "WAIT"