geoffrey
/
hashcode2016
Archivé
1
0
Bifurcation 0
That'll be enough for tonight.

Note that we got 213338 with the following runs
1: 8T/10
2: 8T/10
3: T/2

And we would have been 311 instead of 662 with
very few modifications
master
Geoffrey Frogeye 2016-02-11 23:35:05 +01:00
Parent d30396c471
révision 01a7f8405d
2 fichiers modifiés avec 11 ajouts et 3 suppressions

Voir le fichier

@ -1,7 +1,7 @@
all: 1o 2o 3o ../submission.zip
../submission.zip:
zip $@ .git *.py -r
../submission.zip: 1o 2o 3o
zip $@ .git *o *.py -r
1o: 1
python main.py $<

10
main.py
Voir le fichier

@ -18,6 +18,7 @@ W = 0 # Nb warehouses
C = 0 # Nb customers
t = 0 # Turn
s = 0 # Score
Dp = [] # Positions of drones
# (x, y)
@ -171,6 +172,11 @@ def deliver(d, c, p, q):
assert(Dd[d] <= T)
print("Drone", d, "delivers", q, "of", p, "to client", c, "", Dd[d])
Out.append(str(d) + ' D ' + str(c) + ' ' + str(p) + ' ' + str(q))
# Score
if Ci[c][p] == 0:
global s
s += math.ceil((T-t)/T*100)
def wait(d, w=1):
global Dd, Da
@ -230,7 +236,7 @@ for c in range(C):
N.append((c, p))
try:
while t < T:
while t < T-100:
for d in [d for d in range(D) if Da[d]]:
for tk in Dt[d]:
c, p = tk
@ -276,3 +282,5 @@ def WarehouseHasItems(w, items):
if Wi[w][items[i][0]] < items[i][1]:
return False
return True
sys.stdout.write(str(s)+'\n')