Created
October 26, 2014 16:50
-
-
Save bkopanja/2d3d4b4f8a517692f444 to your computer and use it in GitHub Desktop.
Codingame - 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 java.util.*; | |
import java.io.*; | |
import java.math.*; | |
class Player { | |
public static void main(String args[]) { | |
Scanner in = new Scanner(System.in); | |
int R = in.nextInt(); // the length of the road before the gap. | |
in.nextLine(); | |
int G = in.nextInt(); // the length of the gap. | |
in.nextLine(); | |
int L = in.nextInt(); // the length of the landing platform. | |
in.nextLine(); | |
// game loop | |
while (true) { | |
int S = in.nextInt(); | |
in.nextLine(); | |
int X = in.nextInt(); | |
in.nextLine(); | |
System.err.println(R); | |
if(X == R - 1) | |
System.out.println("JUMP"); | |
else if(X > R - 1) | |
System.out.println("SLOW"); | |
else if(S == G + 1) | |
System.out.println("WAIT"); | |
else if(S > G + 1) | |
System.out.println("SLOW"); | |
else | |
System.out.println("SPEED"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment