5

Divide an array into minimum number of sub-arrays such that each subarray have s...

 2 years ago
source link: http://codeforces.com/blog/entry/96573
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

By Bammmmm, history, 8 minutes ago,

Given an array AA of length NN with positive elements a1,a2,...,aNa1,a2,...,aN and two numbers LL and RR. Divide the array into minimum number of sub-arrays such that each subarray have sum in the range [L,R][L,R].

I thought of two pointers approach but I am sure how to take care of the lower bound of LL on subarray sum. How should we approach this problem?


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK