This repository has been archived on 2019-08-09. You can view files and clone it, but cannot push or open issues or pull requests.
hashcode2016/read.py

53 lines
977 B
Python
Raw Normal View History

2016-02-11 19:24:11 +01:00
#Read the input file
def Read_input_file(file):
f = open(file, 'r')
line = f.readline()
2016-02-11 19:24:11 +01:00
info = line.split(' ')
GRILLE = (int(info[0]), int(info[1]))
D = int(info[2])
T = int(info[3])
M = int(info[4])
line = f.readline()
2016-02-11 19:24:11 +01:00
P = int(line)
line = f.readline()
2016-02-11 19:24:11 +01:00
info = line.split(' ')
for i in range(0, P):
2016-02-11 19:24:11 +01:00
Pw[i] = int(info[i])
line = f.readline()
2016-02-11 19:24:11 +01:00
W = int(line)
for i in range(0, W):
line = f.readline()
2016-02-11 19:24:11 +01:00
info = line.split(' ')
Wp[i] = (int(info[0]), int(info[1]))
line = f.readline()
2016-02-11 19:24:11 +01:00
info = line.split(' ')
2016-02-11 19:36:20 +01:00
productQ = {}
for j in range(1, info.size())+1:
2016-02-11 19:36:20 +01:00
productQ[j] = int(info[j])
Wi[i] = productsQ
line = f.readline()
2016-02-11 19:36:20 +01:00
nbC = int(line)
for i in range(0, nbC):
line = f.readline()
2016-02-11 19:36:20 +01:00
info = line.split(' ')
Cp[i] = (int(info[0]), int(info[1]))
line = f.readline()
2016-02-11 19:36:20 +01:00
nbP = int(line)
line = f.readline()
2016-02-11 19:36:20 +01:00
info = line.split(' ')
orderQ = {}
for j in range(0, nbP):
2016-02-11 19:36:20 +01:00
orderQ[j] = int(info[j])
Ci[i] = orderQ
2016-02-11 19:24:11 +01:00
return