Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.IO;
  4. using System.Text;
  5. using System.Collections;
  6. using System.Collections.Generic;
  7.  
  8. /**
  9. * Auto-generated code below aims at helping you parse
  10. * the standard input according to the problem statement.
  11. **/
  12. class Player
  13. {
  14. static void Main(string[] args)
  15. {
  16. int road = int.Parse(Console.ReadLine()); // the length of the road before the gap.
  17. int gap = int.Parse(Console.ReadLine()); // the length of the gap.
  18. int platform = int.Parse(Console.ReadLine()); // the length of the landing platform.
  19.  
  20. // game loop
  21. while (true)
  22. {
  23. int speed = int.Parse(Console.ReadLine()); // the motorbike's speed.
  24. int coordX = int.Parse(Console.ReadLine()); // the position on the road of the motorbike.
  25.  
  26. // Write an action using Console.WriteLine()
  27. // To debug: Console.Error.WriteLine("Debug messages...");
  28. if(coordX == road - 1){
  29. Console.WriteLine("JUMP");
  30. } else if(coordX > road){
  31. Console.WriteLine("SLOW");
  32. } else {
  33. if(speed > gap * 2 + 1){
  34. Console.WriteLine("SLOW");
  35. } else if (speed < gap * 2 + 1) {
  36. Console.WriteLine("SPEED");
  37. } else{
  38. Console.WriteLine("WAIT");
  39. }
  40. }
  41. // A single line containing one of 4 keywords: SPEED, SLOW, JUMP, WAIT.
  42. }
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement