#C8492. Longest Ascending Path

    ID: 52480 Type: Default 1000ms 256MiB

Longest Ascending Path

Longest Ascending Path

In this problem, you are given a sequence of (n) hills with their respective heights. VK wants to take a walk along these hills following an ascending path. An ascending path is defined as a contiguous segment of hills where each hill is strictly taller than the previous one, i.e. for a segment (h_i, h_{i+1}, \ldots, h_j), it holds that (h_k < h_{k+1}) for all (i \le k < j). Your task is to determine the length of the longest ascending contiguous subarray.

Input Format: The input is read from standard input (stdin). The first line contains a single integer (n) representing the number of hills. The second line contains (n) space-separated integers representing the heights of the hills.

Output Format: Output a single integer representing the length of the longest ascending path. The result should be printed to standard output (stdout).

inputFormat

The input consists of two lines:

  1. The first line contains an integer (n) denoting the number of hills.
  2. The second line contains (n) space-separated integers representing the heights of the hills.

outputFormat

Output a single integer that denotes the length of the longest contiguous ascending sequence among the hills. The output should be printed to stdout.## sample

6
1 2 3 2 5 4
3