Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.72 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. int myVX= 0;
  57. int myVY = 0;
  58. if (unitType == 0 && player == 0) {
  59. myVX = vx;
  60. myVY = vy;
  61. carX = x;
  62. carY = y;
  63.  
  64. if (unitType == 0 && player == 1) {
  65. car1X = x;
  66. car1Y = y;
  67. }
  68. if (unitType == 0 && player == 2) {
  69. car2X = x;
  70. car2Y = y;
  71. }
  72.  
  73. } else if (unitType == 4) {
  74. double dist = StrictMath.hypot(x - carX, y - carY);
  75.  
  76. if (dist < minS) {
  77. minS = dist;
  78. wragX = x - 2 * myVX;
  79. wragY = y - 2 * myVY;
  80. }
  81. }
  82.  
  83. if (unitType == 1 && player == 0) {
  84. tankerX = x;
  85. tankerY = y;
  86. } else if (unitType == 3) {
  87. double dist = StrictMath.hypot(x - tankerX, y - tankerY);
  88.  
  89. if (dist < minPoliceS) {
  90. minPoliceS = dist;
  91. policeX = x;
  92. policeY = y;
  93. }
  94. }
  95. double dist = StrictMath.hypot(car1X - tankerX, car1Y - tankerY);
  96. minVrag = dist;
  97.  
  98.  
  99.  
  100. if (minS < 800) {
  101. flash = 0;
  102. } else {
  103. flash = 300;
  104. }
  105.  
  106. }
  107. if (myRage > 90 && minS < 400) {
  108. System.out.println("SKILL " + wragX + " " + wragY);
  109. } else {
  110. System.out.println(wragX + " " + wragY + " " + 300);
  111. }
  112.  
  113. if (myRage > 60 && minVrag < 2000) {
  114. System.out.println("SKILL " + car1X + " " + car1Y);
  115. } else {
  116. System.out.println(car1X + " " + car1Y + " " + 300);
  117. }
  118. System.out.println(car2X + " " + car2Y + " " + 300);
  119. }
  120.  
  121.  
  122.  
  123. }
  124. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement