Сапрончев Андрей Михайлович, 402 группа MaxSubseq 953 | Токарев Андрей Вадимович, 617 группа MaxSubseq 1066 | ||||
---|---|---|---|---|---|
n | 1 | max_length = 0 | n | 1 | best = 0 |
2 | current_length = 0 | 2 | curr = 0 | ||
3 | prev = None | 3 | prev_num = None | ||
4 | while (number := int(input())): | 4 | while (new := int(input())): | ||
5 | if prev is None or number >= prev: | 5 | if prev_num == None or prev_num <= new: | ||
6 | current_length += 1 | 6 | curr += 1 | ||
7 | else: | 7 | else: | ||
t | 8 | current_length = 1 | t | 8 | curr = 1 |
9 | if current_length > max_length: | 9 | if curr > best: | ||
10 | max_length = current_length | 10 | best = curr | ||
11 | prev = number | 11 | prev_num = new | ||
12 | print(max_length) | 12 | print(best) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|