Created
February 21, 2015 17:22
-
-
Save eric-taix/d498b0fae3ed7af59d88 to your computer and use it in GitHub Desktop.
gc-skynet-the-chasm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:io'; | |
import 'dart:math'; | |
/** | |
* Auto-generated code below aims at helping you parse | |
* the standard input according to the problem statement. | |
**/ | |
void main() { | |
int roadLength = int.parse(stdin.readLineSync()); | |
int gapLength = int.parse(stdin.readLineSync()); | |
int landingLength = int.parse(stdin.readLineSync()); | |
while (true) { | |
int speed = int.parse(stdin.readLineSync()); | |
int bikePos = int.parse(stdin.readLineSync()); | |
int lengthToJump = roadLength - bikePos - 1; | |
if (lengthToJump < 0 || speed > gapLength + 1) print('SLOW'); | |
else if (lengthToJump < speed) print('JUMP'); | |
else if (speed + 1 <= lengthToJump && speed <= gapLength) print('SPEED'); | |
else print('WAIT'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment