题目名称 | 2684. [POJ 1850] 编码 |
---|---|
输入输出 | poj1850.in/out |
难度等级 | ★★ |
时间限制 | 1000 ms (1 s) |
内存限制 | 5 MiB |
测试数据 | 10 |
题目来源 | AAAAAAAAAA 于2017-04-28加入 |
开放分组 | 全部用户 |
提交状态 | |
分类标签 | |
分享题解 |
通过:11, 提交:21, 通过率:52.38% | ||||
AAAAAAAAAA | 100 | 0.000 s | 0.00 MiB | C++ |
1020 | 100 | 0.001 s | 0.31 MiB | C++ |
泪寒之雪 | 100 | 0.002 s | 0.32 MiB | C++ |
thmyl | 100 | 0.002 s | 0.32 MiB | C++ |
1020 | 100 | 0.003 s | 0.32 MiB | C++ |
konnyaku | 100 | 0.003 s | 0.32 MiB | C++ |
bear | 100 | 0.004 s | 0.32 MiB | C++ |
Shirry | 100 | 0.004 s | 0.32 MiB | C++ |
不存在的 | 100 | 0.004 s | 0.32 MiB | C++ |
konnyaku | 100 | 0.004 s | 0.32 MiB | C++ |
关于 编码 的近10条评论(全部评论) | ||||
---|---|---|---|---|
没看见 若不在字典中输出0
所以混分警告
就是20分 | ||||
真是醉了...
|
Transmitting and memorizing information is a task that requires different coding systems for the best use of the available space. A well known system is that one where a number is associated to a character sequence. It is considered that the words are made only of small characters of the English alphabet a,b,c, ..., z (26 characters). From all these words we consider only those whose letters are in lexigraphical order (each character is smaller than the next character).
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
...
Specify for a given word if it can be codified according to this coding system. For the affirmative case specify its code.
题目大意:求出给定的字符在字典中的编码,字典中的单词由小写字母组成且,s满足对于任意字符s[i]<s[i+1]。
字典从"a"开始。
要处理的字母
编号,若不在字典中输出0
bf
55
POJ1850