Reminder: in case of any technical issues, you can use the lightweight website m1.codeforces.com, m2.codeforces.com, m3.codeforces.com. ×

### CopeCope's blog

By CopeCope, history, 8 months ago, ,

Given array A of N <  = 500000 elements and each A[i] <  = N. Find number of partitions of array into some number of subsegments such that every subsegment has length greater or equal to minimum value of subsegment and smaller or equal to maximum value of subsegment.

Example:
A = {1, 6, 2, 3, 4, 3, 4}
Partitions are:
|1|6, 2, 3, 4, 3, 4|
|1, 6, 2|3, 4, 3, 4|
|1, 6, 2, 3|4, 3, 4|
|1|6, 2|3, 4, 3, 4|
|1|6, 2, 3|4, 3, 4|
|1, 6|2, 3|4, 3, 4|

How to solve this problem?

• +21

 » 8 months ago, # |   0
•  » » 8 months ago, # ^ |   0 But there is no editorial.
 » 8 months ago, # |   +3 Isn't it a little strange that this is the only problem from Codechef August Long Challenge 2018 that one can't find a single word about in Codechef discussions?Moreover, no one has ever even asked anything about it...
 » 8 months ago, # |   +1 Anyone?
•  » » 8 months ago, # ^ |   +13 Here is the approach that was shared by tmwilliamlin168 6 months ago (in August 2018 that is).