Андрей Филиппов 608 MaxSubseq 858 | Диана Бочковенкова, 630 группа MaxSubseq 986 | ||||
---|---|---|---|---|---|
n | 1 | x_prev = int(input()) | n | 1 | prev = int(input()) |
2 | result = 1 | 2 | max = 1 | ||
3 | max_result = 1 | 3 | count = 1 | ||
4 | while True: | 4 | while True: | ||
n | 5 | x_cur = int(input()) | n | 5 | cur = int(input()) |
6 | if x_cur == 0: | 6 | if cur == 0: | ||
7 | break | 7 | break | ||
n | 8 | if x_cur >= x_prev: | n | 8 | if cur >= prev: |
9 | result += 1 | 9 | count += 1 | ||
10 | else: | 10 | else: | ||
t | 11 | if max_result < result: | t | 11 | if count > max: |
12 | max_result = result | 12 | max = count | ||
13 | result = 1 | 13 | count = 1 | ||
14 | x_prev = x_cur | 14 | prev = cur | ||
15 | if max_result < result: | 15 | if count > max: | ||
16 | max_result = result | 16 | max = count | ||
17 | print(max_result) | 17 | print(max) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|