No.209 Longest Mountain Subsequence
問題文最終更新日: 2015-11-14 17:48:09
Statement
Find the maximum length of the subsequence
Fig. 1. The view from Nihondaira (Dec. 27th, 2014)
Input
The first line of the input contains an integerThen
All variables are non-negative integers.
Output
For each test cases, print the maximum length of
Sample
Input
4 5 1 2 3 4 5 9 1 2 4 8 100 8 4 2 1 9 1 7 5 3 1 6 3 9 1 1 1
Output
3 9 5 1
In the first case,
In the second case,
In the third case,
In the fourth case, the sequence consisted of only one element is also valid.
補足:
だんだん大きくなって,だんだん小さくなる列で,最大値に近づくほど差が急になるものです.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。