給出一個字符串的序The coding system works like this: • The words are arranged in the increasing order of their length. • The words with the same length are arranged in lexicographical order (the order from the dictionary). • We codify these words by their numbering, starting with a, as follows: a - 1 b - 2 ... z - 26 ab - 27 ... az - 51 bc - 52 ... vwxyz - 83681 ... 然后給出一個字符串,要求求在字典中的位置。設狀態dp[l][p]為長度為l的字符串且以p為字母開頭的個數為多少。dp[l][p]=sum{dp[l-1][i]} i>k下面就不用解釋了吧- -
posted on 2010-10-28 00:58 yzhw 閱讀(102) 評論(0) 編輯 收藏 引用 所屬分類: DP
Powered by: C++博客 Copyright © yzhw