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