Help on VOJ problems!!!

Revision en1, by 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

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English abcxyz1 2015-12-01 05:44:52 511 Initial revision (published)