Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Type or paste question here Problem description Books There are B different books with IDs from 0 to B-1. Many libraries can have a copy
Type or paste question here
Problem description Books There are B different books with IDs from 0 to B-1. Many libraries can have a copy of the same book, but we only need to scan each book once. Each book is described by one parameter: the score that is awarded when the book is scanned. Libraries There are L different libraries with IDs from 0 to L-1. Each library is described by the following parameters: the set of books in the library, the time in days that it takes to sign the library up for scanning, the number of books that can be scanned each day from the library once the library is signed up. Time There are D days from day to day D-1. The first library signup can start on day 0.D-1 is the last day during which books can be shipped to the scanning facility. Library signup Each library has to go through a signup process before books from that library can be shipped. Only one library at a time can be going through this process (because it involves lots of planning and on-site visits at the library by logistics experts): the signup process for a library can start only when no other signup processes are running. The libraries can be signed up in any order. Books in a library can be scanned as soon as the signup process for that library completes (that is, on the first day immediately after the signup process, see the figure below). Books can be scanned in parallel from multiple libraries. hash code Book scanning Problem statement for the Online Qualification Round of Hash Code 2020 Introduction Books allow us to discover fantasy worlds and better understand the world we live in. They enable us to learn about everything from photography to compilers... and of course a good book is a great way to relax! Google Books is a project that embraces the value books bring to our daily lives. It aspires to bring the world's books online and make them accessible to everyone. In the last 15 years, Google Books has collected digital copies of 40 million books in more than 400 languages', partly by scanning books from libraries and publishers all around the world. In this competition problem, we will explore the challenges of setting up a scanning process for millions of books stored in libraries around the world and having them scanned at a scanning facility. Task 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. For example, if the signup process for library 0 (that is, the library with ID O) takes 2 days, and the signup process for library 1 takes 3 days, and library 1 is signed up before library O then the signup process of library 1 starts on day O, and finishes on day 2 (3 days in total) the first books from library 1 can be scanned starting on day 3 (the next day after the signup process finishes) the signup of library O starts on day 3 (the next day after the signup process of library O is done) and finishes on day 4 (2 days in total) the first books from library O can be scanned starting on day 5 (the next day after the signup process finishes) Library 0 signup process Library 1 signup process Days 0 1 2 3 4 5 ... Figure. The signup process (blue bars) and the books being scanned from each library per day. Only one library can be in the signup process at a time, but books can be shipped in parallel by multiple libraries. Scanning All books are scanned in the scanning facility. The entire process of sending the books, scanning them, and returning them to the library happens in one day (note that each library has a maximum number of books that can be scanned from this library per day). The scanning facility is big and can scan any number of books per day. For example, if library O has 5 books, can ship 2 books per day, and completes the signup process on day 1, then: 2 books can be scanned on day 2 2 books can be scanned on day 3 the one remaining book can be scanned on day 4 Library o signup process Days 0 1 2 2 3 4 Input data set File format Each input data set is provided in a plain text file. The file contains only ASCII characters with lines ending with a single ' ' character (also called "UNIX-style line endings). When multiple numbers are given in one line, they are separated by a single space between each two numbers. The first line of the data set contains: Input data set File format Each input data set is provided in a plain text file. The file contains only ASCII characters with lines ending with a single " ' character (also called "UNIX-style" line endings). When multiple numbers are given in one line, they are separated by a single space between each two numbers. The first line of the data set contains: an integer B (1sBs 105) the number of different books, an integer L (15Ls 10%) the number of libraries, an integer D (15DStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started