Лазарев Артур Дмитриевич 514 HalfMore 2585 | Михаил Успенский 616 ВМК МГУ HalfMore 493 | ||||
---|---|---|---|---|---|
n | 1 | majority = None | n | 1 | majority_element = None |
2 | count = 0 | 2 | count = 0 | ||
3 | while True: | 3 | while True: | ||
4 | line = input().strip() | 4 | line = input().strip() | ||
5 | if not line: | 5 | if not line: | ||
6 | break | 6 | break | ||
7 | if count == 0: | 7 | if count == 0: | ||
n | 8 | majority = line | n | 8 | majority_element = line |
9 | count = 1 | 9 | count = 1 | ||
n | 10 | elif line == majority: | n | 10 | elif line == majority_element: |
11 | count += 1 | 11 | count += 1 | ||
12 | else: | 12 | else: | ||
13 | count -= 1 | 13 | count -= 1 | ||
t | 14 | print(eval(majority)) | t | 14 | print(eval(majority_element)) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|