ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1296. Hyperjump

To everyone : Algorithm to solve this problem ! Very easy !
calculate : fmax(n) = max(fmax(n-1)+value(n),value(n));
Re: To everyone : Algorithm to solve this problem ! Very easy !
Posted by D_T_F 23 Mar 2009 04:24
Why?
Consider p1 = 5, p2 = -2

fmax(1) = 5
fmax(2) = max( 5+(-2), -2 ) = 3

But if i = j = 1 fmax(2) = 5

Or I got wrong understanding of the task?
Re: To everyone : Algorithm to solve this problem ! Very easy !
Posted by Nguyen Dang Duy 10 Dec 2011 11:17
F[i] is max values of sequence with the final element is a[i].

Finally, answer will be max( F[1], ... F[n] ).
Sorry because of English.
Re: To everyone : Algorithm to solve this problem ! Very easy !
Posted by thebvog 18 Jan 2012 20:58
It's wrong algorithm and more hard than right.