AT_abc459_b.459
入门
通过率:0%
时间限制:2.00s
内存限制:1024MB
AC君温馨提醒
该题目为【atcoder】题库的题目,您提交的代码将被提交至atcoder进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given N strings S1,S2,…,SN consisting of lowercase English letters.
Define N digits C1,C2,…,CN as follows:
- If the first character of Si is one of
a,b,c, then Ci=2 - If the first character of Si is one of
d,e,f, then Ci=3 - If the first character of Si is one of
g,h,i, then Ci=4 - If the first character of Si is one of
j,k,l, then Ci=5 - If the first character of Si is one of
m,n,o, then Ci=6 - If the first character of Si is one of
p,q,r,s, then Ci=7 - If the first character of Si is one of
t,u,v, then Ci=8 - If the first character of Si is one of
w,x,y,z, then Ci=9
Output the string obtained by concatenating C1,C2,…,CN in this order.
给你 N 个由小写英文字母组成的字符串 S1,S2,…,SN。
定义 N 个数字 C1,C2,…,CN 如下:
- 若 Si 的首字符为
a、b或c,则 Ci=2 - 若 Si 的首字符为
d、e或f,则 Ci=3 - 若 Si 的首字符为
g、h或i,则 Ci=4 - 若 Si 的首字符为
j、k或l,则 Ci=5 - 若 Si 的首字符为
m、n或o,则 Ci=6 - 若 Si 的首字符为
p、q、r或s,则 Ci=7 - 若 Si 的首字符为
t、u或v,则 Ci=8 - 若 Si 的首字符为
w、x、y或z,则 Ci=9
请输出将 C1,C2,…,CN 按此顺序拼接后得到的字符串。
输入格式
The input is given from Standard Input in the following format:
N
S1 S2 … SN
输入从标准输入中按以下格式给出:
N
S1 S2 … SN
输出格式
Output the string obtained by concatenating C1,C2,…,CN in this order.
按此顺序连接 C1,C2,…,CN 后得到的字符串。
输入输出样例
输入#1
2 algorithm heuristic
输出#1
24
输入#2
3 i love you
输出#2
459
说明/提示
Sample 1 Explanation:
- The first character of S1=
algorithmisa, so C1=2. - The first character of S2=
heuristicish, so C2=4.
Thus, output 24, which is their concatenation.
Constraints
- 1≤N≤10
- N is an integer.
- Si is a string of length between 1 and 10, inclusive, consisting of lowercase English letters.
样例 1 解释:
- S1=
algorithm的首字符为a,因此 C1=2。 - S2=
heuristic的首字符为h,因此 C2=4。
因此,输出其拼接结果 24。
约束条件
- 1≤N≤10
- N 是一个整数。
- Si 是一个长度在 1 到 10(含)之间的字符串,仅由小写英文字母组成。
输入解题思路,AI测评打分。不知道怎么写?