HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Chapter 3. Repetition structures > problem:


10. Maximum

Volume problems

• 01. How many digits?
• 02. How many divisors?
• 04. Train
• 05. Factorial
• 06. X to the power of Y
• 07. Fibonacci Series
• 08. Binary to decimal
• 09. Decimal to binary
• 10. Maximum
• 11. Perfect numbers
• 12. Wonder primes
• 13. Round numbers
• 14. Tower of Happiness
• 2. Molecules
• The power of 2

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 1000/1000/1000/1000 ms. Memory limit 65000/65000/65000/65000 Kb.

Problem description

You are given the list of N integers. Make a program to find the maximum item in the list.

Finding the maximum and minimum items is a fundamental algorithm in programming and has many applications. The algorithm is as follows:

Keep the first item as the maximum, and compare each item with the maximum. If the new value is bigger than the maximum, maximum gets the value of the new item.

Input

There is a single integer N on the first line (1 ≤ N ≤ 1000000), and N integres ai on the second line (|ai| < 2*109).

Output

Print the maximum value.

Example

stdin stdout

3
2 5 3

5

Для отправки решений необходимо выполнить вход.

www.contester.ru