eolymp
bolt
Try our new interface for solving problems
Problems

Maximum in Unimodal Sequence

Maximum in Unimodal Sequence

Sequence $a_i$ is called \textbf{unimodal} if there exists such index $p$ that $a_1 < a_2 < ... < a_p$ and $a_p > a_{p+1} > ... > a_n$. Value $a_p$ is maximum in this sequence. You must find this value. \InputFile The first line contains the size of array $n~(n \le 10^6)$. The next line contains $n$ positive integers that represent a unimodal sequence. Numbers in array do not exceed $10^9$. \OutputFile Print the maximum element is the unimodal sequence.
Time limit 1 second
Memory limit 128 MiB
Input example #1
10
2 4 7 12 18 19 16 11 8 3
Output example #1
19
Input example #2
6
3 5 7 11 15 17
Output example #2
17
Author Michael Medvediev