Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import math
- # Send your busters out into the fog to trap ghosts and bring them home!
- busters_per_player = int(input()) # the amount of busters you control
- ghost_count = int(input()) # the amount of ghosts on the map
- my_team_id = int(input()) # if this is 0, your base is on the top left of the map, if it is one, on the bottom right
- def find_closest(x, y, ghosts, bid):
- dist=18000
- tx,ty,tid=0,0,0
- for a in ghosts:
- temp=sqrt((x-a[0])**2+(y-a[1])**2)
- if temp<dist:
- dist=temp
- tx=a[0]
- ty=a[1]
- tid=a[2]
- if dist<1760:
- print("BUST "+tid)
- else:
- print("MOVE "+tx+" "+ty)
- # game loop
- while True:
- entities = int(input()) # the number of busters and ghosts visible to you
- ghosts = [[]]
- for i in range(entities):
- # entity_id: buster id or ghost id
- # y: position of this buster / ghost
- # entity_type: the team id if it is a buster, -1 if it is a ghost.
- # state: For busters: 0=idle, 1=carrying a ghost.
- # value: For busters: Ghost id being carried. For ghosts: number of busters attempting to trap this ghost.
- entity_id, x, y, entity_type, state, value = [int(j) for j in input().split()]
- if entity_type==-1:
- ghosts+=[x,y,entity_id]
- for i in range(entities):
- # entity_id: buster id or ghost id
- # y: position of this buster / ghost
- # entity_type: the team id if it is a buster, -1 if it is a ghost.
- # state: For busters: 0=idle, 1=carrying a ghost.
- # value: For busters: Ghost id being carried. For ghosts: number of busters attempting to trap this ghost.
- entity_id, x, y, entity_type, state, value = [int(j) for j in input().split()]
- if entity_type==my_team_id:
- if ghosts:
- find_closest(x, y, ghosts, bid)
- else:
- print("MOVE 8000 4500")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement