AT_abc459_b.459

入门

通过率:0%

时间限制:2.00s

内存限制:1024MB

AC君温馨提醒

该题目为【atcoder】题库的题目,您提交的代码将被提交至atcoder进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

You are given NN strings S1,S2,…,SNS_1, S_2, \ldots, S_N consisting of lowercase English letters.

Define NN digits C1,C2,…,CNC_1, C_2, \ldots, C_N as follows:

  • If the first character of SiS_i is one of a, b, c, then Ci=C_i= 2
  • If the first character of SiS_i is one of d, e, f, then Ci=C_i= 3
  • If the first character of SiS_i is one of g, h, i, then Ci=C_i= 4
  • If the first character of SiS_i is one of j, k, l, then Ci=C_i= 5
  • If the first character of SiS_i is one of m, n, o, then Ci=C_i= 6
  • If the first character of SiS_i is one of p, q, r, s, then Ci=C_i= 7
  • If the first character of SiS_i is one of t, u, v, then Ci=C_i= 8
  • If the first character of SiS_i is one of w, x, y, z, then Ci=C_i= 9

Output the string obtained by concatenating C1,C2,…,CNC_1, C_2, \ldots, C_N in this order.

给你 NN 个由小写英文字母组成的字符串 S1,S2,…,SNS_1, S_2, \ldots, S_N。

定义 NN 个数字 C1,C2,…,CNC_1, C_2, \ldots, C_N 如下:

  • 若 SiS_i 的首字符为 a、b 或 c,则 Ci=2C_i = 2
  • 若 SiS_i 的首字符为 d、e 或 f,则 Ci=3C_i = 3
  • 若 SiS_i 的首字符为 g、h 或 i,则 Ci=4C_i = 4
  • 若 SiS_i 的首字符为 j、k 或 l,则 Ci=5C_i = 5
  • 若 SiS_i 的首字符为 m、n 或 o,则 Ci=6C_i = 6
  • 若 SiS_i 的首字符为 p、q、r 或 s,则 Ci=7C_i = 7
  • 若 SiS_i 的首字符为 t、u 或 v,则 Ci=8C_i = 8
  • 若 SiS_i 的首字符为 w、x、y 或 z,则 Ci=9C_i = 9

请输出将 C1,C2,…,CNC_1, C_2, \ldots, C_N 按此顺序拼接后得到的字符串。

输入格式

The input is given from Standard Input in the following format:

NN
S1S_1 S2S_2 …\ldots SNS_N

输入从标准输入中按以下格式给出:

NN
S1S_1 S2S_2 …\ldots SNS_N

输出格式

Output the string obtained by concatenating C1,C2,…,CNC_1, C_2, \ldots, C_N in this order.

按此顺序连接 C1,C2,…,CNC_1, C_2, \ldots, C_N 后得到的字符串。

输入输出样例

  • 输入#1

    2
    algorithm heuristic

    输出#1

    24
  • 输入#2

    3
    i love you

    输出#2

    459

说明/提示

Sample 1 Explanation:

  • The first character of S1=S_1= algorithm is a, so C1=C_1= 2.
  • The first character of S2=S_2= heuristic is h, so C2=C_2= 4.

Thus, output 24, which is their concatenation.

Constraints

  • 1≤N≤101 \leq N \leq 10
  • NN is an integer.
  • SiS_i is a string of length between 11 and 1010, inclusive, consisting of lowercase English letters.

样例 1 解释:

  • S1=S_1 = algorithm 的首字符为 a,因此 C1=C_1 = 2。
  • S2=S_2 = heuristic 的首字符为 h,因此 C2=C_2 = 4。

因此,输出其拼接结果 24。

约束条件

  • 1≤N≤101 \leq N \leq 10
  • NN 是一个整数。
  • SiS_i 是一个长度在 11 到 1010(含)之间的字符串,仅由小写英文字母组成。

输入解题思路,AI测评打分。不知道怎么写?

首页