Advertisement
abhisekp

CodinGame - Skynet: the Chasm

Jan 31st, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1.         // game loop
  2.         while (true) {
  3.             int S = in.nextInt(); // the motorbike's speed.
  4.             int X = in.nextInt(); // the position on the road of the motorbike.
  5.  
  6.             if(X == R - 1) {
  7.                 System.out.println("JUMP");
  8.             } else if((X > R + G) || (X + S > R) || (G+1 < S)) {
  9.                 System.out.println("SLOW");
  10.             } else if(G+1 == S) {
  11.                 System.out.println("WAIT");
  12.             } else {
  13.                 System.out.println("SPEED");
  14.             }
  15.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement