generated from Gophing-Around/hashcode-golang-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
44 lines (36 loc) · 1.09 KB
/
main.go
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
43
44
package main
import (
"fmt"
"io/ioutil"
)
func main() {
files := []string{
// "a_an_example",
// "b_better_start_small",
// "c_collaboration",
// "d_dense_schedule",
// "e_exceptional_skills",
"f_find_great_mentors",
}
for _, fileName := range files {
fmt.Printf("Processing input: %s\n", fileName)
inputSet := readFile(fmt.Sprintf("./inputFiles/%s.in.txt", fileName))
maxDays, config, contributors, projects, rolesContributor := buildInput(inputSet)
// fmt.Printf("Config %+v\n", config)
// for _, contrib := range contributors {
// fmt.Printf("Contributor %+v\n", contrib)
// }
// for _, project := range projects {
// fmt.Printf("Project %+v\n", project)
// for _, role := range project.rolesMap {
// fmt.Printf(">> Role %+v\n", role)
// }
// }
printInputMetrics(config)
result := algorithm(maxDays, config, contributors, projects, rolesContributor)
output := buildOutput(result)
printResultMetrics(config)
ioutil.WriteFile(fmt.Sprintf("./result/%s.out", fileName), []byte(output), 0644)
fmt.Printf("Wrote output for: %s\n", fileName)
}
}