Advertisement
George_Ivanov05

0.1

Jul 17th, 2021
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.81 KB | None | 0 0
  1. string = input().split(":")
  2. my_dict = {}
  3.  
  4. while string[0] != "end of contests":
  5.     course = string[0]
  6.     password = string[1]
  7.     my_dict[course] = password
  8.     string = input().split(":")
  9.  
  10.  
  11. commands = input().split("=>")
  12. dict_name_score = {}
  13.  
  14. while commands[0] != "end of submissions":
  15.     course_name = commands[0]
  16.     given_password = commands[1]
  17.     students_name = commands[2]
  18.     points = int(commands[3])
  19.     for key, value in my_dict.items():
  20.         if value == given_password and course_name == key and students_name not in dict_name_score:
  21.             dict_name_score[students_name] = points
  22.         elif value == given_password and course_name == key and students_name in my_dict:
  23.             dict_name_score[students_name] += points
  24.     commands = input().split("=>")
  25. print(dict_name_score)
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement