Блог пользователя CopeCope

Автор CopeCope, история, 5 лет назад, По-английски

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
  • Проголосовать: не нравится

»
5 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
»
5 лет назад, # |
  Проголосовать: нравится +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...

»
5 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

Anyone?