CopeCope's blog

By CopeCope, history, 5 years ago, In English

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?

  • Vote: I like it
  • +21
  • Vote: I do not like it

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it
»
5 years ago, # |
  Vote: I like it +3 Vote: I do not like it

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...

»
5 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Anyone?