Help on VOJ problems!!!

Правка en1, от abcxyz1, 2015-12-01 05:44:52

Given a string of length N (N<=200) contains characters from '0' to '9'. In each step, you can cut a substring that contains the same characters and get a reward equal to the square of the length of substring. After that, if the string is seperated into two substrings, the two will be merged into a new string. All you have to do is calculating the maximum reward you can get. Example, you have '100011', you can first cut '000', new string '111', thus the maximum reward is 3^2+3^2=18

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский abcxyz1 2015-12-01 05:44:52 511 Initial revision (published)