SecondMax/Dr.Slink | SecondMax/shaleka | ||||
---|---|---|---|---|---|
t | 1 | t | 1 | ||
2 | s = int(input()) | 2 | s = int(input()) | ||
3 | secondMax = firstMax = s | 3 | secondMax = firstMax = s | ||
4 | wereSecond = False | 4 | wereSecond = False | ||
5 | 5 | ||||
6 | while s: | 6 | while s: | ||
7 | if s != firstMax: | 7 | if s != firstMax: | ||
8 | if secondMax == firstMax and s < firstMax: | 8 | if secondMax == firstMax and s < firstMax: | ||
9 | secondMax = s | 9 | secondMax = s | ||
10 | elif s > firstMax: | 10 | elif s > firstMax: | ||
11 | secondMax = firstMax | 11 | secondMax = firstMax | ||
12 | firstMax = s | 12 | firstMax = s | ||
13 | elif s > secondMax: | 13 | elif s > secondMax: | ||
14 | secondMax = s | 14 | secondMax = s | ||
15 | 15 | ||||
16 | s = int(input()) | 16 | s = int(input()) | ||
17 | 17 | ||||
18 | if secondMax == firstMax: | 18 | if secondMax == firstMax: | ||
19 | print('NO') | 19 | print('NO') | ||
20 | else: | 20 | else: | ||
21 | print(secondMax) | 21 | print(secondMax) | ||
22 | 22 |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|