#C5763. Longest Increasing Sales Sequence
Longest Increasing Sales Sequence
Longest Increasing Sales Sequence
You are given the sales numbers for N consecutive days. Your task is to find the longest sequence of consecutive days with strictly increasing sales. In case there are multiple sequences with the same maximum length, choose the earliest one.
If the input list is empty (N = 0), output 0 0 0
. Otherwise, if the longest increasing sequence starts at day \(i\) and has length \(L\), then its end day is \(i+L-1\) and the required output is:\\
\(i,\; i+L-1,\; L\).
inputFormat
The input is read from stdin. The first line contains an integer N
representing the number of days. If N > 0
, the second line contains N
space-separated integers representing the sales amounts for each day.
outputFormat
Output to stdout three space-separated integers: the start day index, the end day index, and the length of the longest increasing sales sequence.## sample
9
3 4 5 1 2 3 4 1 2
4 7 4