#Lutece1163. Intervals Query
Intervals Query
Migrated from Lutece 1163 Intervals Query
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Given an Array with length (), find a longest consecutive sub-interval on Array satisfied that there is no more than 1 minimum number and no more than 1 maximum number in the sub-interval.
Input
The first line contains an integer () meaning the length of Array .
The second line contains integers ().
Output
Output two integers and representing the length of the longest consecutive sub-interval on Array satisfied the condition and the starting position in Array (starts from 1).
If there are multiple answers, you can output any of them.
Samples
Resources
2015 UESTC ACM Summer Training Team Selection (4)