Here'e a prob. I've been struggling with...Plz. help!!!

Can someone explain the statement of the HYPERSPACEPATHS prob. from the INOI Practice Server…
If possible, please describe the solution…

2 Likes

Make 2 DP Arrays.

DP1(i) denotes min sum possible by a single section of size k using plots 1…i .

DP2(i) denotes min sum possible by a single section of size k using plots i…n .

Loop i from 1 to n-1:

Take min of DP1(i)+DP2(i+1) over all i.

EDIT- Sorry, My bad. I did not read the problem carefully.

@roxtar123, i think there is slight mistake in your solution.

DP1(i) denotes min sum possible by a single section of size k using 1…i plots.

DP2(i) denotes min sum possible by a single section of size k using i…n plots

Loop i from 1 to n-1

Take min of DP1(i)+DP2(i+1) over all i

What say?

@arpanb8, please be patient. Why such a hurry? People will reply when they are free, no one is under any obligation to answer your queries and yet people are trying to help. So please be a little grateful and less impatient.

1 Like