Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_track():
- track_name, author, year = map(str.strip, input().split("|"))
- return (track_name, author, int(year))
- tracks = dict()
- n = int(input())
- for _ in range(n):
- track, author, year = get_track()
- if(track not in tracks) or (tracks[track][1] > year):
- tracks[track] = (author, year)
- out = ["{} - {}".format(author, track) for track, (author, year) in tracks.items()]
- out.sort()
- print(*out, sep="\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement