Skip to content

Instantly share code, notes, and snippets.

@eric-taix
Created February 21, 2015 17:22
Show Gist options
  • Save eric-taix/d498b0fae3ed7af59d88 to your computer and use it in GitHub Desktop.
Save eric-taix/d498b0fae3ed7af59d88 to your computer and use it in GitHub Desktop.
gc-skynet-the-chasm
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