HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > CEN111 Homeworks 2013-2015 > problem:


15-FallHW-2. 50821 - Derivative of an array

CEN111 Homeworks 2013-2015

Start: Jan.10.2015 at 10:00:00 AM
Finish: Jan.10.2015 at 03:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (1)

Contest problems

• 14-Fall2-40. 50514 - Bookkeeping
• 14-Fall2-50. 50534 - Top Trading C...
• 14-Fall2-60. 50487 - Radius of Inscr...
• 14-FallResit-20. 50407 - Missing Nu...
• 14-Spr2-10. 50426 - Calculating Sales
• 14-Spr2-20. 50425 - Calculating W...
• 14-Spr2-30. 50445 - Cryptography
• 14-Spr2-50. 50437 - Age Labeling
• 15-FallHW-2. 50821 - Derivativ...
• 15-FallHW-3. 50822 - Linked List
• 15-FallHW-4. 50823 - Secret Number
• 15-FallHW-5. 50824 - Sum of Group...
• 15-FallHW-6. 50825 - Drawing Polygon
• 15-FallPr-10. 50808 - Total Distance...
• 15-FallPr-50. 50812 - Total Discount...
• 15-FallPr-70. 50814 - Buying Books f...
• 15-FallPr-80. 50815 - Breaking the ...

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