#P6807. [BalticOI 2010] Matching Bins (Day2)
[BalticOI 2010] Matching Bins (Day2)
Description
You are given a sequence of integers . Let .
You need to find the largest integer such that, from left to right, the first numbers are all smaller than the next numbers.
Input Format
The first line contains two integers , representing the maximum value in the sequence and the number of elements.
The second line contains integers .
Output Format
Output one integer on a single line: the maximum .
5 10
2 2 1 4 3 2 5 4 2 3
4
Hint
For of the testdata, it is guaranteed that , , .
This problem is translated from BalticOI 2010 Day2 T1 Matching Bins。
Translated by ChatGPT 5
京公网安备 11011102002149号