-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Kolatat Thangkasemvathana <kolatat.t@gmail.com> Co-authored-by: jameskriang <jameskriang@gmail.com>
- Loading branch information
1 parent
a7ba109
commit 6409d9f
Showing
14 changed files
with
84,322 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Google Books ? | ||
|
||
## Henlo I am live?WTF | ||
|
||
### WTF? | ||
|
||
## Problems | ||
|
||
Book: | ||
ID | ||
Score | ||
|
||
Library: | ||
Set of books | ||
Time it take to scan | ||
Number of books that can be scanned each day | ||
|
||
Time: | ||
Days | ||
|
||
## Algorithm | ||
|
||
- Sturcts of Books and Lib | ||
- Create a scoring mechanism | ||
- Boundary Optimisation - Remove those that were unable do within remaining time | ||
- Sort | ||
|
||
## FAQ | ||
|
||
https://codingcompetitions.withgoogle.com/hashcode/faq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package common | ||
|
||
// Books is a type of all books | ||
type Book struct { | ||
ID uint32 | ||
Score uint32 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package common | ||
|
||
type Library struct { | ||
ID uint32 | ||
Books []uint32 | ||
Score uint32 | ||
SignUp uint32 | ||
Ship uint32 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module github.com/natebwangsut/hashcode-2020-henlo-fiesta/online-qualification/go | ||
|
||
go 1.13 | ||
|
||
replace github.com/natebwangsut/hashcode-2020-henlo-fiesta/online-qualification/go => ./ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"os" | ||
|
||
"github.com/natebwangsut/hashcode-2020-henlo-fiesta/online-qualification/go/common" | ||
) | ||
|
||
func main() { | ||
f, err := os.Open("../samples/a_example.txt") | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
defer f.Close() | ||
|
||
// Fuck im too stoopid to open a fucking file | ||
var numBooks, numLibs, numDays uint32 | ||
fmt.Fscanf(f, "%d %d %d\n", &numBooks, &numLibs, &numDays) | ||
|
||
books := make([]common.Book, numBooks) | ||
for i := range books { | ||
books[i].ID = uint32(i) | ||
fmt.Fscanf(f, "%d", &books[i].Score) | ||
} | ||
fmt.Fscanln(f) | ||
|
||
libraries := make([]common.Library, numLibs) | ||
for i := range libraries { | ||
lib := &libraries[i] | ||
var libNumBooks uint32 | ||
fmt.Fscanf(f, "%d %d %d\n", &libNumBooks, &lib.SignUp, &lib.Ship) | ||
lib.Books = make([]*common.Book, libNumBooks) | ||
for j := range lib.Books { | ||
var bookId uint32 | ||
fmt.Fscanf(f, "%d", &bookId) | ||
lib.Books[j] = &books[j] | ||
} | ||
fmt.Fscanln(f) | ||
} | ||
|
||
fmt.Printf("%+v\n", libraries) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package score | ||
|
||
// ScoreLibrary based on books and its signup time | ||
func ScoreLibrary([]type.Library) []type.Library { | ||
|
||
} |
Binary file not shown.
Binary file added
BIN
+357 KB
online-qualification/problem-statement/hashcode_2020_online_qualification_round.pdf
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
6 2 7 | ||
1 2 3 6 5 4 | ||
5 2 2 | ||
0 1 2 3 4 | ||
4 3 1 | ||
0 2 3 5 |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
60,003 changes: 60,003 additions & 0 deletions
60,003
online-qualification/samples/d_tough_choices.txt
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
2,003 changes: 2,003 additions & 0 deletions
2,003
online-qualification/samples/f_libraries_of_the_world.txt
Large diffs are not rendered by default.
Oops, something went wrong.