Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- import java.io.*;
- import java.math.*;
- /**
- * Auto-generated code below aims at helping you parse
- * the standard input according to the problem statement.
- **/
- class Player {
- public static void main(String args[]) {
- Scanner in = new Scanner(System.in);
- // game loop
- while (true) {
- int car1X = 0;
- int car1Y = 0;
- int car2X = 0;
- int car2Y = 0;
- int tankerX = 0;
- int tankerY = 0;
- int policeX = 0;
- int policeY = 0;
- int carX = 0;
- int carY = 0;
- int wragX = 0;
- int wragY = 0;
- double minVrag = 1000000;
- double minS = 1000000;
- double minPoliceS = 1000000;
- int flash = 300;
- int myScore = in.nextInt();
- int enemyScore1 = in.nextInt();
- int enemyScore2 = in.nextInt();
- int myRage = in.nextInt();
- int enemyRage1 = in.nextInt();
- int enemyRage2 = in.nextInt();
- int unitCount = in.nextInt();
- for (int i = 0; i < unitCount; i++) {
- int unitId = in.nextInt();
- int unitType = in.nextInt();
- int player = in.nextInt();
- float mass = in.nextFloat();
- int radius = in.nextInt();
- int x = in.nextInt();
- int y = in.nextInt();
- int vx = in.nextInt();
- int vy = in.nextInt();
- int extra = in.nextInt();
- int extra2 = in.nextInt();
- if (unitType == 0 && player == 1 ) {
- car1X = x;
- car1Y = y;
- }
- if (unitType == 0 && player == 2) {
- car2X = x;
- car2Y = y;
- }
- if (unitType == 0 && player == 0) {
- carX = x;
- carY = y;
- } else if (unitType == 4) {
- double dist = StrictMath.hypot(x - carX, y - carY);
- if (dist < minS) {
- minS = dist;
- wragX = x;
- wragY = y;
- }
- }
- if (unitType == 1 && player == 0) {
- tankerX = x;
- tankerY = y;
- } else if (unitType == 3) {
- double dist = StrictMath.hypot(x - tankerX, y - tankerY);
- if (dist < minPoliceS) {
- minPoliceS = dist;
- policeX = x;
- policeY = y;
- }
- }
- double dist = StrictMath.hypot(car1X - tankerX, car1Y - tankerY);
- if (dist < minVrag) {
- minVrag = dist;
- }
- // Write an action using
- //To debug: System.err.println("Debug messages...");
- if (myRage >= 0) {
- System.out.println(wragX + " " + wragY + " " + 300);
- }
- if (myRage >= 60 && minVrag <= 2000) {
- System.out.println("SKILL " + car2X + " " + car2Y + " BOOM!!!!!");
- } else {
- System.out.println(policeX + " " + policeY + " " + 300);
- }
- System.out.println(car2X + " " + car2Y + " " + 300);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement