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