To solve this problem you have to complete the code that you will find at the end of the statement. You have to replace each ??? with one or more lines of code. Do not change anything else. Download from the website of the problem the file code.cc with the code to be completed (click on the corresponding button “.CPP”), edit it and submit it to the judge.
A historian maintains a database with several anniversaries. For each one, we have the date, a brief description, and a number that indicates its relevance. Dates only include the month and the day (in this order), but not the year. In addition, the system only allows us to save one event for each date.
The historian’s program allows us to do five different operations:
Input
Input consists of several operations as indicated above. Dates use two digits for the month and for the day, and a ‘/’ to separate them. Descriptions are strings made with lowercase letters, digits and dashes. Relevances are integer numbers between 1 and 109.
Output
For each operation (except save operations), print the requested information.
Input
n m s 05/20 barca-champions-league 200 a 05/20 e s 11/20 franco-death 700 m s 09/11 fall-of-barcelona 1000 e m s 09/11 september-11-attacks 1001 n m a 09/11
Output
number events: 0 maximum relevance: 0 barca-champions-league ERROR: at least two events needed maximum relevance: 700 900 maximum relevance: 1000 ERROR: repeated date number events: 3 maximum relevance: 1000 fall-of-barcelona