영어 원문입니다. 원문의 수식·표를 글자로 옮겨 모양이 다를 수 있습니다. 정확한 내용은 원문 페이지에서 확인하세요. 원문 페이지 열기 (새 창)
시간 제한 1초 · 메모리 제한 512 MB
Problem
There are n mountains in a row, each with a specific height. You begin your hang gliding route from some mountain.
You can glide from mountain a to mountain b if mountain a is taller than mountain b and all mountains between a and b.
What is the maximum number of mountains you can visit on your route?
Input
The first line has an integer n: the number of mountains.
The next line has n integers h_1, h_2,…, h_n: the heights of the mountains.
Output:
Print one integer: the maximum number of mountains.
Constraints
- 1 ≤ n ≤ 2 · 10^5
- 1 ≤ h_i ≤ 10^9
예제
예제 1
10 20 15 17 35 25 40 12 19 13 12
5