Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- end_com = 'exam finished'
- line = input()
- submissions = {}
- users = {}
- while line != end_com:
- args = line.split('-')
- if args[1] == 'banned':
- if users.get(args[0]):
- del users[args[0]]
- else:
- submissions.setdefault(args[1], []).append(int(args[2]))
- users.setdefault(args[0], []).append(int(args[2]))
- line = input()
- print("Results:")
- [print(f"{k} | {max(v)}") for k, v in sorted(users.items(), key=lambda x: (-max(x[1]), x[0]))]
- print("Submissions:")
- [print(f"{k} - {len(v)}") for k, v in sorted(submissions.items(), key=lambda x: (-len(x[1]), x[0]))]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement