#P1246. 编码
编码
Description
Encoding is often used for ciphertext or compressed transmission. Here we use one of the simplest methods: map some structured words to numbers.
There are letters in the alphabet, . These special words have length at most , and their letters are in strictly increasing order. Put all such words together and sort them in lexicographic order. The code of a word is the position of that word in this dictionary.
For example:
- .
- .
- .
- .
- .
Your task is to compute the code of the given word.
Input Format
A single line containing the word to be encoded.
Output Format
A single line containing the corresponding code. If the word is not in this dictionary, output .
ab
27
Hint
Translated by ChatGPT 5
京公网安备 11011102002149号