|
@@ -4,13 +4,63 @@
|
|
|
HashCode 2016
|
|
|
"""
|
|
|
|
|
|
-#
|
|
|
-## Code goes here.
|
|
|
-#
|
|
|
+#///////////////////////////////////////////////////////////////////////////////
|
|
|
+#// \ /
|
|
|
+#// \ \_\_ _/_/ /
|
|
|
+#// \ \__/ /
|
|
|
+#// --- (oo)\_______ / /
|
|
|
+#// (__)\ )\/ /
|
|
|
+#// ||-----|| /
|
|
|
+#// || || /
|
|
|
+#///////////////////////////////////////////////////////////////////////////////
|
|
|
+
|
|
|
+
|
|
|
+def parse(file_name):
|
|
|
+ """ Open the file and parse it"""
|
|
|
+ f = open(file_name)
|
|
|
+ line = f.readline()
|
|
|
+ rows, cols, drones, turns, max_payload = map(int,line.split(' ') )
|
|
|
+
|
|
|
+ line = f.readline()
|
|
|
+ products = line.split(' ')
|
|
|
+
|
|
|
+ line = f.readline()
|
|
|
+ products = map(int, line.split(' ') )
|
|
|
+
|
|
|
+ line = f.readline()
|
|
|
+ warehouse_nb = int(line.split(' ')[0])
|
|
|
+
|
|
|
+ warehouses = {}
|
|
|
+ for i in range(warehouse_nb):
|
|
|
+ line = f.readline()
|
|
|
+ pos = map(int, line.split(' ') )
|
|
|
+
|
|
|
+ line = f.readline()
|
|
|
+ products = map(int, line.split(' ') )
|
|
|
+
|
|
|
+ warehouses[i] = (pos, products)
|
|
|
+
|
|
|
+ line = f.readline()
|
|
|
+ products_nb = int(line.split(' ')[0])
|
|
|
+
|
|
|
+ orders = []
|
|
|
+ for i in range(products_nb):
|
|
|
+ line = f.readline()
|
|
|
+ pos = map(int, line.split(' ') )
|
|
|
+
|
|
|
+ line = f.readline()
|
|
|
+ line = f.readline()
|
|
|
+ items = map(int, line.split(' ') )
|
|
|
+
|
|
|
+ orders.append((pos, items))
|
|
|
+
|
|
|
+ return rows, cols, drones, turns, max_payload, products, warehouses, orders
|
|
|
|
|
|
def test():
|
|
|
"""Testing Docstring"""
|
|
|
+
|
|
|
pass
|
|
|
|
|
|
if __name__=='__main__':
|
|
|
+ print parse("../busy_day.in")
|
|
|
test()
|