SecondMax/iljakz | SecondMax/s60170124 | ||||
---|---|---|---|---|---|
n | 1 | x = int(input()) | n | 1 | b = int(input()) |
2 | f_max = x | 2 | maximum = b | ||
3 | s_max = -1 | 3 | ans = 0 | ||
4 | while x != 0: | 4 | while b != 0: | ||
5 | if x > f_max: | 5 | if b > maximum: | ||
6 | s_max = f_max | 6 | ans = maximum | ||
7 | f_max = x | 7 | maximum = b | ||
8 | elif x > s_max and x != f_max: | 8 | elif b > ans and b < maximum: | ||
9 | s_max = x | 9 | ans = b | ||
10 | x = int(input()) | 10 | b = int(input()) | ||
11 | if s_max == -1: | 11 | if ans == 0: | ||
12 | print("NO") | 12 | print("NO") | ||
13 | else: | 13 | else: | ||
t | 14 | print(s_max) | t | 14 | print(ans) |
15 | 15 |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|