| Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 86966 | sh25_zhangyy | 花匠(Day 2) | C++ | 编译错误 | 0 MS | 0 KB | 309 | 2026-04-10 14:54:30 |
n = int(input()) h = list(map(int, input().split())) if n <= 1: print(n) else: up = 1 down = 1 for i in range(1, n): if h[i] > h[i-1]: up = down + 1 elif h[i] < h[i-1]: down = up + 1 # if equal, do nothing print(max(up, down))