All problems

Problem 820

Longest Continuous Increasing Subsequence

Easy · 10 pts · Array

Problem

Find the length of the longest block of consecutive elements that is strictly increasing (each element larger than the one before it). Unlike the longest increasing subsequence, the elements here must be next to each other. Scan once, extending the current run when the next element is larger and starting a new run of length 1 otherwise, and remember the longest run.

Input

The first line contains an integer N, the size of the array. The second line contains N space-separated integers A[0], A[1], ..., A[N-1].

Output

Print the length of the longest strictly increasing contiguous block.

Constraints

1 <= N <= 100000; -10^9 <= A[i] <= 10^9

Example input

5
1 3 5 4 7

Example output

3

Explanation

In 1 3 5 4 7, the block 1 3 5 is strictly increasing with length 3, and the run restarts at 4. So the answer is 3.

Every problem here can be used in a RelayTrixCode team match. Create a room.

Previous: Global and Local Inversions Next: Count Number of Teams