Logo
(追記) (追記ここまで)

33778번 - Administration 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB159763.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:

  • When a customer borrows a book: "$t$ - $g$ borrows $b$" Where integer 0ドル \leq t \leq 10^{6}$ is the day after the opening of the library, $g$ the name of the user and $b$ the name of the book.
  • When a customer returns a book: "$t$ - $g$ returns $b$" Where integer 0ドル \leq t \leq 10^{6}$ is the day after the opening of the library, $g$ the name of the user and $b$ the name of the book.
  • When an employee returns some books to a bookshelf: "$t$ - $n$ books become available" here integer 0ドル \leq t \leq 10^{6}-1$ is the day after the opening of the library, 1ドル \leq n \leq 1000$ the number of books that are removed from the pile and become available for borrowing.

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.

제한

예제 입력 1

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

예제 출력 1

CORRUPT

예제 입력 2

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

예제 출력 2

Berty E0.00
John E10.00
Sophie E1.15

힌트

출처

University > Delft University of Technology > Sjaars Kampioenschap Programmeren 2014 A번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /