40 lines
677 B
Python
40 lines
677 B
Python
#!/usr/bin/env python3
|
|
|
|
import math
|
|
|
|
print("#hashcode2016")
|
|
|
|
X = 0 # Nb rows
|
|
Y = 0 # Nb columns
|
|
D = 0 # Nb drones
|
|
T = 0 # Deadline
|
|
M = 0 # Maximum load
|
|
P = 0 # Nb products
|
|
W = 0 # Nb warehouses
|
|
C = 0 # Nb customers
|
|
|
|
Dp = []; # Positions of drones
|
|
# (x, y)
|
|
Di = []; # Items of drones
|
|
# {product number: qt}
|
|
Dd = []; # Turn avaibility of drone
|
|
# int
|
|
|
|
Pw = []; # Weight of products
|
|
# int
|
|
|
|
Wp = []; # Positions of warehouses
|
|
# (x, y)
|
|
Wi = []; # Items of warehouses
|
|
# {product number: qt}
|
|
|
|
Cp = []; # Positions of customers
|
|
# (x, y)
|
|
Ci = []; # Needs of customers
|
|
# {product number: qt}
|
|
|
|
def distance(A, B):
|
|
return math.ceil(sqrt(pow((B[0] - A[0], 2) + pow(B[1] - A[1], 2))))
|
|
|
|
|