-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinput.py
42 lines (32 loc) · 1.06 KB
/
input.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import os
path_files = {
"a": os.path.join("inputs", "a_an_example.in.txt"),
"b": os.path.join("inputs", "b_better_start_small.in.txt"),
"c": os.path.join("inputs", "c_collaboration.in.txt"),
"d": os.path.join("inputs", "d_dense_schedule.in.txt"),
"e": os.path.join("inputs", "e_exceptional_skills.in.txt"),
"f": os.path.join("inputs", "f_find_great_mentors.in.txt"),
}
def read_file(file_path):
with open(file_path) as file:
content = file.read()
return content
def separate_first_line(content):
# find the index of the first '\n'
index = content.find('\n')
first_line = content[:index]
content = content[index+1:]
return first_line, content
def split_first_line(line):
c,p = map(lambda x:int(x),line.split(' '))
return c,p
def read_contributors(content, C):
pass
def read_projects(content, P):
pass
def line_content(line):
#???? why?
values = line.split(' ')
first_value = int(values[0])
line = values[1:]
return first_value, line