No.1455 Extended ROTN
レベル :
/ AI推定難易度 : 725
/ 実行時間制限 : 1ケース 2.000秒 / メモリ制限
: 512 MB / 標準ジャッジ問題
タグ : / 解いたユーザー数 133
作問者 :
Falcon_
/ テスター :
shiomusubi496
NaHCO314
タグ : / 解いたユーザー数 133
作問者 :
shiomusubi496
問題文最終更新日: 2021-11-22 00:20:19
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
新入生プログラミングコンテスト 2021(夜の部)
(順位表)
の他の問題:
Problem Statement
We define the operation of shifting a character $c$ by $1$ as follows.
- If $c$ is a lowercase English letter, replace $c$ with the letter $1$ position after it in alphabetical order. However, if $c$ is
z, replace it witha. - If $c$ is an uppercase English letter, replace $c$ with the letter $1$ position after it in alphabetical order. However, if $c$ is
Z, replace it withA. - If $c$ is a digit, regard $c$ as a number and replace it with the number obtained by adding $1$. However, if $c$ is
9, replace it withCpCzNkSuTbEoA.
Given $S_0$ and $N$, find $S_N$.
Constraints
- $S_0$ is a string consisting of lowercase English letters, uppercase English letters, and digits
- $N$ is given as an integer
- $1\leq |S_0|\leq 100$
- $0\leq N\leq 10^{18}$
Input
$S_0$ $N$
Output
$S_N$
Print $S_N$ on one line, followed by a newline.
Sample
Sample 1
Input
CpCzNkSuTbEoA 2
Output
ErEbPmUwVdGqC
$S_1$ is DqDaOlTvUcFpB, and $S_2$ is ErEbPmUwVdGqC.
Sample 2
Input
3141592653589793238ushitapu 7
Output
CpCzNkSuTbEoA8DqDaOlTvUcFpB8ErEbPmUwVdGqCIvIfTqYaZhKuG9FsFcQnVxWeHrDErEbPmUwVdGqCCpCzNkSuTbEoAErEbPmUwVdGqCHuHeSpXzYgJtFIvIfTqYaZhKuGGtGdRoWyXfIsEIvIfTqYaZhKuGCpCzNkSuTbEoA9CpCzNkSuTbEoAHuHeSpXzYgJtFbzopahwb
Note that a number turns into a string when it becomes $10$ or more, and remains a digit when it is $9$ or less.
Also, if digits are included, $|S_0| < |S_N|$ may hold, but it can be proven that $|S_N| \leq1300$ under these constraints.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。