Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.65 KB | None | 0 0
  1. import java.util.*;
  2. import java.io.*;
  3. import java.math.*;
  4.  
  5. /**
  6. * Auto-generated code below aims at helping you parse
  7. * the standard input according to the problem statement.
  8. **/
  9. class Player {
  10.  
  11. public static void main(String args[]) {
  12. Scanner in = new Scanner(System.in);
  13.  
  14. // game loop
  15. while (true) {
  16. int car1X = 0;
  17. int car1Y = 0;
  18. int car2X = 0;
  19. int car2Y = 0;
  20. int tankerX = 0;
  21. int tankerY = 0;
  22. int policeX = 0;
  23. int policeY = 0;
  24.  
  25. int carX = 0;
  26. int carY = 0;
  27. int wragX = 0;
  28. int wragY = 0;
  29.  
  30. double minVrag = 1000000;
  31. double minS = 1000000;
  32. double minPoliceS = 1000000;
  33. int flash = 300;
  34.  
  35. int myScore = in.nextInt();
  36. int enemyScore1 = in.nextInt();
  37. int enemyScore2 = in.nextInt();
  38. int myRage = in.nextInt();
  39. int enemyRage1 = in.nextInt();
  40. int enemyRage2 = in.nextInt();
  41.  
  42. int unitCount = in.nextInt();
  43.  
  44. for (int i = 0; i < unitCount; i++) {
  45. int unitId = in.nextInt();
  46. int unitType = in.nextInt();
  47. int player = in.nextInt();
  48. float mass = in.nextFloat();
  49. int radius = in.nextInt();
  50. int x = in.nextInt();
  51. int y = in.nextInt();
  52. int vx = in.nextInt();
  53. int vy = in.nextInt();
  54. int extra = in.nextInt();
  55. int extra2 = in.nextInt();
  56. if (unitType == 0 && player == 1 ) {
  57. car1X = x;
  58. car1Y = y;
  59. }
  60. if (unitType == 0 && player == 2) {
  61. car2X = x;
  62. car2Y = y;
  63. }
  64.  
  65. if (unitType == 0 && player == 0) {
  66. carX = x;
  67. carY = y;
  68. } else if (unitType == 4) {
  69. double dist = StrictMath.hypot(x - carX, y - carY);
  70.  
  71. if (dist < minS) {
  72. minS = dist;
  73. wragX = x;
  74. wragY = y;
  75. }
  76. }
  77.  
  78. if (unitType == 1 && player == 0) {
  79. tankerX = x;
  80. tankerY = y;
  81. } else if (unitType == 3) {
  82. double dist = StrictMath.hypot(x - tankerX, y - tankerY);
  83.  
  84. if (dist < minPoliceS) {
  85. minPoliceS = dist;
  86. policeX = x;
  87. policeY = y;
  88. }
  89. }
  90. double dist = StrictMath.hypot(car1X - tankerX, car1Y - tankerY);
  91. if (dist < minVrag) {
  92. minVrag = dist;
  93. }
  94.  
  95. // Write an action using
  96.  
  97.  
  98. //To debug: System.err.println("Debug messages...");
  99.  
  100.  
  101. if (myRage >= 0) {
  102. System.out.println(wragX + " " + wragY + " " + 300);
  103. }
  104.  
  105. if (myRage >= 60 && minVrag <= 2000) {
  106. System.out.println("SKILL " + car2X + " " + car2Y + " BOOM!!!!!");
  107. } else {
  108. System.out.println(policeX + " " + policeY + " " + 300);
  109. }
  110. System.out.println(car2X + " " + car2Y + " " + 300);
  111. }
  112. }
  113. }
  114. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement