Skip to content

Instantly share code, notes, and snippets.

@bkopanja
Created October 26, 2014 16:50
Show Gist options
  • Save bkopanja/2d3d4b4f8a517692f444 to your computer and use it in GitHub Desktop.
Save bkopanja/2d3d4b4f8a517692f444 to your computer and use it in GitHub Desktop.
Codingame - SKYNET - THE CHASM
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