CF474A.Keyboard

入门

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

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

题目描述

Our good friend Mole is trying to code a big message. He is typing on an unusual keyboard with characters arranged in following way:

qwertyuiop
asdfghjkl;
zxcvbnm,./

Unfortunately Mole is blind, so sometimes it is problem for him to put his hands accurately. He accidentally moved both his hands with one position to the left or to the right. That means that now he presses not a button he wants, but one neighboring button (left or right, as specified in input).

We have a sequence of characters he has typed and we want to find the original message.

我们的好朋友鼹鼠(Mole)正在输入一条长消息。他使用的是一个布局特殊的键盘,字符排列如下:

qwertyuiop  
asdfghjkl;  
zxcvbnm,./  

不幸的是,鼹鼠是盲人,因此有时难以准确地将双手放在正确的位置上。他不小心将双手整体向左或向右移动了一个位置。这意味着:他现在按下的不是本想按的键,而是其左侧或右侧相邻的键(具体方向由输入指定)。

我们已知鼹鼠实际输入的字符序列,需要还原出原始消息。

输入格式

First line of the input contains one letter describing direction of shifting ('L' or 'R' respectively for left or right).

Second line contains a sequence of characters written by Mole. The size of this sequence will be no more than 100. Sequence contains only symbols that appear on Mole's keyboard. It doesn't contain spaces as there is no space on Mole's keyboard.

It is guaranteed that even though Mole hands are moved, he is still pressing buttons on keyboard and not hitting outside it.

输入的第一行包含一个字母,表示移位方向(‘L’ 表示向左移位,‘R’ 表示向右移位)。

第二行包含鼹鼠输入的一串字符。该字符串长度不超过 100。字符串中仅包含鼹鼠键盘上存在的符号;不包含空格,因为鼹鼠的键盘上没有空格键。

保证:尽管鼹鼠的手发生了移动,他仍始终按在键盘按键上,而不会击打到键盘之外的位置。

输出格式

Print a line that contains the original message.

打印一行包含原始消息的内容。

输入输出样例

  • 输入#1

    R
    s;;upimrrfod;pbr

    输出#1

    allyouneedislove

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

首页