### water's blog

By water, 7 years ago, ,

I still can't figure out how to solve this problem after I read the tuturial. Can you write your idea carefully :(

• -8

 » 7 years ago, # |   +5 you want to solve the problem for ( 1 , n ) where 1 is first array and n is the last array. for solving ( i, n) first solve ( i+1 , n ), thus you'll have a integer S, ( 0<= S <= a[i+1] ) and if S>= a[i] then s= s-a[i] , and if s
•  » » 7 years ago, # ^ |   0 I got AC using your idea.:) I really appreciate you and care about your country.:)
•  » » 7 years ago, # ^ |   0 I think your expression is better than the tuturial.:)
•  » » » 7 years ago, # ^ |   0 thank U, but where's the tuturial?
 » 7 years ago, # | ← Rev. 2 →   0 Let solve this task for all suffixes of array in increasing of size order. For last element it's easy, because it's in [0..an]. let fi is the sum we get for ai..anLet's add 1 element. Then ai — fi + 1 is in [-ai..ai], so ai — fi + 1 or fi + 1 — ai is OK.
•  » » 7 years ago, # ^ |   0 You always help me a lot!;)