Skip to content

slaifan/HC2020

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HC2020

This project is for designing an algorithm to be used in Google Hashcode 2020 coding competition. The full details of the challenge can be found here.

Summary:

Given a description of libraries and books available, plan which books to scan from which library to maximize the total score of all scanned books, taking into account that each library needs to be signed up before it can ship books.

How It Works:

This solution takes a greedy approach. It first sorts the Libraries based on their potential worth in a descending order. the algorithm then gets lifetime number of books of first (most valuable) Library by calculating

lifetime value = scan rate * days till deadline after registration

Then it iterates over the next Library and removes the books that have already been scheduled to be scanned and adds the next most valuable books in that Library to the list. Then it does the same for all Libraries that can be scanned before time runs out.

Scores:

  1. example: 21
  2. read on: 5,822,900
  3. incunabula: 3,493,443
  4. tough choices: 3,493,945
  5. so many books: 71,170
  6. libraries of the world: 13,512

TOTAL: 12,894,991

Authors:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages