| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 15 | 9 | 7 | 63.636% |
Johnny is going to found his own library in a small village. There's only one problem, he needs a system to manage the administration of his new library. Therefore we ask you to help him to create this system. The goal of the system is to read a log and check if it's valid or not. When the log is valid, the system should output the amount each customer needs to pay.
Customers can borrow a book for free, but when a book is not returned within 3 days, a fine is charged of 0,23 € a day. When a customer has not returned a book at the end of the log, he will be charged 10,00 € without the charge per day. Customers can only borrow books that are on a bookshelf. Johnny has one employee, whose job is to bring books back to one of the bookcases. When a customer returns a book to the library it will be placed on a huge pile of books, but a customer can never return a book he didn't borrow. The employee picks up some books from the top of the pile every once in a while. The library will be in small village, therefore he decides to have only one copy of a every book. The log consists of one of the following actions: a user rents a book, a users brings back a certain book or the employee picks up a number of books from the pile.
The input for every test case consists of a single line with the integer 1ドル \leq n \leq 1000,ドル the amount of lines of the log. Every next line in the log is one of the following cases:
Note: every name of a book or a person is a string that doesn't contain any whitespace. Also note that the log is in chronological order.
When the log is not consistent with the rules described above print on one single line the word "CORRUPT". Else you must print for every customer the amount they need to pay in the below format. The output lines need to be sorted in alphabetical order on the name of the customers.
6 1 - Sophie borrows Romeo_and_Juliet 2 - Johnny returns Romeo_and_Juliet 3 - Sophie borrows The_Da_Vinci_Code 5 - Berty borrows The_Hunger_Games 5 - 3 books become available 7 - Sophie returns The_Da_Vinci_Code
CORRUPT
8 0 - Sophie borrows Romeo_and_Juliet 3 - Sophie borrows The_Da_Vinci_Code 4 - Berty borrows The_Hunger_Games 5 - Sophie returns Romeo_and_Juliet 6 - Berty returns The_Hunger_Games 7 - 1 books become available 7 - John borrows The_Hunger_Games 9 - Sophie returns The_Da_Vinci_Code
Berty E0.00 John E10.00 Sophie E1.15