Merge branch 'master' of github.com:GeoffreyFrogeye/hashcode2016
This commit is contained in:
commit
18070e0fb8
12
main.py
12
main.py
|
@ -237,3 +237,15 @@ while t < 10:
|
||||||
f = open(sys.argv[1] + 'o', 'w')
|
f = open(sys.argv[1] + 'o', 'w')
|
||||||
f.write(str(len(Out)) + '\n' + '\n'.join(Out) + '\n')
|
f.write(str(len(Out)) + '\n' + '\n'.join(Out) + '\n')
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
|
def SortCustomer():
|
||||||
|
CpSort = []
|
||||||
|
for i in range(0, len(Cp)):
|
||||||
|
CpSort.append((i, Cp[i], distance(Wp[0], Cp[i])))
|
||||||
|
CpSort.sort(key=lambda tup: tup[2])
|
||||||
|
|
||||||
|
def WarehouseHasItems(w, items):
|
||||||
|
for i in range(0, len(items):
|
||||||
|
if Wi[w][items[i][0]] < items[i][1]:
|
||||||
|
return False
|
||||||
|
return True
|
Reference in a new issue