#K71207. Minimum Partitions to Form Strictly Increasing Subarrays

    ID: 33480 Type: Default 1000ms 256MiB

Minimum Partitions to Form Strictly Increasing Subarrays

Minimum Partitions to Form Strictly Increasing Subarrays

Given an array \(A\) of \(n\) integers, partition the array into the minimum number of contiguous subarrays such that each subarray is strictly increasing. A subarray is strictly increasing if for every consecutive pair of elements \(A[i]\) and \(A[i+1]\), the condition \(A[i] < A[i+1]\) holds. Determine the minimum number of partitions needed.

inputFormat

The input consists of two lines. The first line contains a single integer \(n\) (\(1 \le n \le 10^5\)), representing the number of elements in the array. The second line contains \(n\) space-separated integers \(A[0], A[1], \ldots, A[n-1]\), which may be positive, negative, or zero.

outputFormat

Output a single integer denoting the minimum number of contiguous partitions needed so that each partition forms a strictly increasing subarray.

## sample
5
1 2 3 4 5
1

</p>