Михаил Успенский 616 ВМК МГУ HalfMore 493 | Лазарев Артур Дмитриевич 514 HalfMore 2585 | ||||
---|---|---|---|---|---|
n | 1 | majority_element = None | n | 1 | majority = 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_element = line | n | 8 | majority = line |
9 | count = 1 | 9 | count = 1 | ||
n | 10 | elif line == majority_element: | n | 10 | elif line == majority: |
11 | count += 1 | 11 | count += 1 | ||
12 | else: | 12 | else: | ||
13 | count -= 1 | 13 | count -= 1 | ||
t | 14 | print(eval(majority_element)) | t | 14 | print(eval(majority)) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|