HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Array and Matrices > problem:


50821 - Derivative of an array

Guest
• Review clarifications (1)

Volume problems

• 50515 - Lines - Revisited
• 50999 - Overlapping Trips
• 50507 - Sequential Numbers
• 50449 - The biggest result
• 50442 - Polynomial Addition
• 50434 - Row Min Subtraction
• 50870 - ZScore normalization
• 50869 - Birthday Celebration
• 50821 - Derivative of an array
• 50513 - Climbing Up the Stairs
• 50854 - Area of Triangle Revised
• 50520 - Filling a Matrix Randomly
• 50497 - Falling Bricks - Revisited
• 50847 - The first m trains to leave
• 50669 - Area of an Irregular Polygon
• 50860 - Number of Student Certificates
• 50444 - n digit kth number divisible...

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