ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Сборники > Chapter 3. Repetition structures > задача:


10. Maximum

Задачи сборника

• 01. How many digits?
• 02. How many divisors?
• 04. Поезд
• 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

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 1000/1000/1000/1000 мс. Лимит памяти 65000/65000/65000/65000 Кб.

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