HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Unsorted > problem:


50821 - Derivative of an array

Guest
• Review clarifications (1)

Section problems

• 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

Feedback

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

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
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