cswork / OA打开练习工作台

MicrosoftOA #4

Roll Operation on String

估计中等可在线判题

考点(AI 标注)前缀和区间字符串

Each operation cyclically increments the first k lowercase letters once, with z becoming a. Output the string after performing all operations in order.

输入格式

The first line contains the string s (1..100000 lowercase letters); the second line contains the number of operations m (1..100000); the third line contains m values of k, with 1≤k≤|s|.

输出格式

Output the final lowercase string.

样例 1

输入:

abz
3
3 2 1

输出:

dda

样例 2

输入:

z
1
1

输出:

a

样例 3

输入:

abc
2
1 1

输出:

cbc

样例说明

Example 1: the three prefix operations give bca, cda, dda in turn.

Example 2: z cyclically increments to a.

Example 3: only the first character is incremented, twice, so abc becomes cbc.