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

Разделы > Unsorted > задача:


50821 - Derivative of an array

Гость
• Вопросы к жюри (1)

Задачи раздела

• 50810 - Print Office
• 50952 - Derby Tirana
• 50443 - Dajte Express
• 50819 - Linked Numbers
• 50519 - Image Filtering
• 50798 - Passing the course
• 50799 - OSHEE Electric Bill
• 50833 - Min of Odd Positions
• 50821 - Derivative of an array
• 50808 - Total Distance Traveled
• 50817 - The Knight Move
• 50537 - esreveR Triangle
• 50402 - Hello World!
• 503013 - DNA
• 50966 - TVSH
• 50970 - Marbles
• 50943 - Word Game

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

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

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Question by Ibrahim Mesecan.

Derivative of an array

In math, derivative is the change between states. In image processing, when calculating the derivative of a series of numbers previous number is subtracted from this number. And the result is written into this position.

Question: Write a program that reads an array, and then calculates the the biggest change in the new array.

Input specification
In the first line, you will be given one integer: array length (n). Then, in the following n lines you will be given n integers where each number is between -2e4 and 2e4 and 0 ≤ n ≤ 30,000.

Output specification:
Show one integer: the biggest change in the derivative of the array.
Note: Assume that you have zero (0) before the first number.

Sample Input I
5
15
52
75
34
40
Sample Output I
41

Explanation: The difference array contains (difference between ai and ai-1) : 15, 37, 23, 41, 6.
So, the biggest change is 41.



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

www.contester.ru