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

Common Board

anish Dynamic Programming-Google question [3] 10 Jun 2013 22:10
Given an array of integers. Find two disjoint contiguous sub-arrays such that the absolute difference between the sum of two sub-array is maximum.
* The sub-arrays should not overlap.

example- array [2, -1, -2, 1, -4, 2, 8]
answer - first (-1 -2 1 -4) Second (2 8), Maximum difference = (10-(-6)) 16.

Can you please provide recurrence relation for Dynamic Programming to solve this?It would be nice if it is accompanied with explanation.

Mahammad Valiyev Re: Dynamic Programming-Google question [2] 11 Jun 2013 19:36

Edited by author 12.06.2013 00:01

Edited by author 12.06.2013 00:01
Mahammad Valiyev Re: Dynamic Programming-Google question 11 Jun 2013 20:37
But you can do it in N^4 time also by using brute force , You appear this question during interview process ?
Mahammad Valiyev Re: Dynamic Programming-Google question 12 Jun 2013 00:01