Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- team_name = {}
- team_win = {}
- """
- 8
- Надежда Анна Павел
- Андрей Дарья Лука
- Илья Анна Павел
- Илья Аркадий Павел
- Лука Дарья Андрей
- Кристина Лука Жора
- Надежда Жора Кристина
- Кристина Мария Анна
- """
- for i in range(n):
- a = input().split() #после input - забыл скобки ()
- team = a[0] + a[1] + a[2]
- """
- print("ITEREATION")
- print("a")
- print(a)
- print("team")
- print(team)
- print()
- """
- if team not in team_name.keys():#исправление: заменил два if-а на один
- team_name[team] = a
- team_win[team] = 1
- else:
- team_win[team] += 1
- """
- print("team_name")
- print(team_name)
- print("team_win")
- print(team_win)
- print("END")
- print()
- """
- """
- debug
- """
- """
- debug
- """
- res = []
- for team in team_name.keys():
- item = []
- item.append(0)
- item.append(0)
- item[0] = team_win[team]#исправление - исправил индексы
- item[1] = team_name[team]
- res.append(item)
- res = sorted(res)
- winner = res[len(res) - 1]
- winner_name = sorted(winner[1])
- print(winner_name, ":", winner[0])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement