Advertisement
Korotkodul

Gazprom_N5_my_sol_v1

Mar 21st, 2023 (edited)
707
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. n = int(input())
  2. team_name = {}
  3. team_win = {}
  4.  
  5. for i in range(n):
  6.     a = input().split() #после input - забыл скобки ()
  7.     team = a[0] + a[1] + a[2]
  8.     if team not in team_name.keys():
  9.         team_name[team] = a
  10.     if team not in team_name.keys():
  11.         team_name[team] = a
  12.     if team not in team_name.keys():
  13.         team_win[team] = 1
  14.     else:
  15.         team_win[team] += 1
  16.  
  17. res = []
  18. for team in team_name.keys():
  19.     item = []
  20.     item.append(0)
  21.     item.append(0)
  22.     item[1] = team_win[team]
  23.     item[2] = team_name[team]
  24.     res.append(item)
  25.  
  26. res = sorted(res)
  27. winner = res[len(res) - 1]
  28.  
  29. winner_name = sorted(winner[1])
  30. print(winner_name, ":", winner[0])
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement