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

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

Given an array of n integer elements. At a single moment we can delete a subarray if every element of this subarray is equal to one another. Doing so give us the points equal to (size of subarray)^2. We have to completely eliminate the array and also maximise the sum of points scored. How to solve this problem?

Score will change on the basis of order.

Eg:

Array = 11212

say it divided into 4 segments 11,2,1,2

If you choose order of segments as 3,(2,4),1. then score will be 1+4+4.

If you choose order of segments as 2,4,(1,3). then score will be 1+1+9.

amitgomi thanks for this example.

  • Проголосовать: нравится
  • +17
  • Проголосовать: не нравится

»
7 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

What are the constraints? Time Limit etc. ? Max.Size of array?

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

I think it is similar to 1132F - Удали строку

»
7 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by wh1te_whale (previous revision, new revision, compare).