Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string = input().split(":")
- my_dict = {}
- while string[0] != "end of contests":
- course = string[0]
- password = string[1]
- my_dict[course] = password
- string = input().split(":")
- commands = input().split("=>")
- dict_name_score = {}
- while commands[0] != "end of submissions":
- course_name = commands[0]
- given_password = commands[1]
- students_name = commands[2]
- points = int(commands[3])
- for key, value in my_dict.items():
- if value == given_password and course_name == key and students_name not in dict_name_score:
- dict_name_score[students_name] = points
- elif value == given_password and course_name == key and students_name in my_dict:
- dict_name_score[students_name] += points
- commands = input().split("=>")
- print(dict_name_score)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement