这两个题实际上是一样的 后面一个数据范围要大些
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
要求给出一个字符串让你求出它的序号
以一个5位字符串为例
1 先求出1-4位所有字符串的个数 就是C(26,i);
2 再从该5位字符串第二位开始到最后一位 每位所取数字都在S[I-1]+1到S[I]-1之间,而后对后面几位用组合数求个数 累计相加就是