|
|||
Open Data About Train TimetableThe National Railway Company of Landia decided to publish the whole train timetable information as open data. Being very enthusiastic, the web developer Andrew creates a website to include these open data. Bad surprise: the published information is just ordinary fake. Andrew analyzes very carefully the open data and discovers a lot of inconsistencies. The published information includes some fictitious trains, some trains are missing, the information about running restrictions are erroneous, etc. Your task is to find all mismatches in a given timetable. Input SpecificationThe input contains the following information:
Output SpecificationYou have to print the list of all mismatches (regarding the number of trains and restrictions). Mismatches must be lexicographically ordered by the name of the departure and arrival stations. Follow the format of the sample output. Sample Input
Output for Sample Input
ExplanationThere are two trains from Bucuresti to Budapest and two trains from Budapest to Bucuresti, but there is a mismatch regarding the restrictions. There are two trains from Paris to Roma and one train from Roma to Paris, therefore there is a mismatch regarding the number of trains. In this case, the other type of mismatch (regarding the restrictions) is not signaled. Note that each route with mismatches must be considered only once. For example, signal only Paris - Roma, don't signal Roma - Paris. |
|||
University of Debrecen; Faculty of Informatics; v. 09/30/2024 |