abcxyz1's blog

By abcxyz1, history, 8 years ago, In English

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

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