Георгий Попандопуло, 520 группа PokeMon 7715
Пахненко Иван 516 PokeMon 7042
tt1"""
20 / Misdreavus
3Svjatoslav Devjatkov / 3
42 / Yamask
5Vsevid Mladenov / 1
61 / Keldeo
70 / Keldeo
81 / Misdreavus
92 / Scatterbug
100 / Crawdaunt
112 / Keldeo
121 / Vanillite
13Svjatoslav Devjatkov / 0
142 / Gardevoir
15Neljub Mstislavin / 2
162 / Crawdaunt
170 / Yamask
183 / Reshiram
19"""
1card_name = {}20card_name = {}
2people_card = {}21people_card = {}
322
4def check_int(s):23def check_int(s):
5    try:24    try:
6        int(s)25        int(s)
7        return True26        return True
8    except:27    except:
9        return False28        return False
10while True:29while True:
11    cur_str = input().split(' / ')30    cur_str = input().split(' / ')
12    if cur_str == ['']:31    if cur_str == ['']:
13        break32        break
14    if check_int(cur_str[0]):33    if check_int(cur_str[0]):
15        cur_str[0] = int(cur_str[0])34        cur_str[0] = int(cur_str[0])
16        if cur_str[0] not in card_name:35        if cur_str[0] not in card_name:
17            card_name[cur_str[0]] = set()36            card_name[cur_str[0]] = set()
18        card_name[cur_str[0]].add(cur_str[1])37        card_name[cur_str[0]].add(cur_str[1])
19    else:38    else:
20        cur_str[1] = int(cur_str[1])39        cur_str[1] = int(cur_str[1])
21        if cur_str[0] not in people_card:40        if cur_str[0] not in people_card:
22            people_card[cur_str[0]] = set()41            people_card[cur_str[0]] = set()
23        people_card[cur_str[0]].add(cur_str[1])42        people_card[cur_str[0]].add(cur_str[1])
24people_count = {}43people_count = {}
25max_count = 044max_count = 0
26for i in people_card.keys():45for i in people_card.keys():
27    cur_set = set()46    cur_set = set()
28    for j in people_card[i]:47    for j in people_card[i]:
29        cur_set.update(card_name[j])48        cur_set.update(card_name[j])
30    temp = len(cur_set)49    temp = len(cur_set)
31    people_count[i] = temp50    people_count[i] = temp
32    if temp > max_count:51    if temp > max_count:
33        max_count = temp52        max_count = temp
34for i in sorted(people_count):53for i in sorted(people_count):
35    if people_count[i] == max_count:54    if people_count[i] == max_count:
36        print(i)55        print(i)
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op