No.292 Stage Name
タグ : / 解いたユーザー数 661
作問者 :
nmnmnmnmnmnmnm
/ テスター :
Problem Statement
A-kun, a comedian, came up with the stage name $S$.
First, he asked Master B for an opinion and was told to delete the single character at position $t$ (0-indexed) from the beginning.
Next, he asked Master C for an opinion and was told to delete the single character at position $u$ (0-indexed) from the beginning.
A-kun decided to delete characters exactly as Master B and Master C told him.
If the opinions of Master B and Master C are the same, one character is deleted.
If the opinions of Master B and Master C are different, two characters are deleted.
Given $S$, $t$, and $u$, answer the name that results from getting the opinions of Master B and Master C.
Input
$S$ $t$ $u$
The string $S$ consists of lowercase letters.
$3 \le 文字列Sの長さ \le 50$.
$0 \le t \le 文字列Sの長さ-1$.
$0 \le u \le 文字列Sの長さ-1$.
Output
Output A-kun's resulting stage name on one line.
Print a newline at the end.
Sample
Sample 1
Input
yukicoder 0 4
Output
ukioder
The stage name A-kun first came up with is yukicoder.
First, Master B told him to delete the 0th character, y, from yukicoder.
Next, Master C told him to delete the 4th character, c, from yukicoder.
In the end, A-kun deleted y and c, and his stage name was decided to be ukioder.
Sample 2
Input
aaa 0 0
Output
aa
Both Master B and Master C told him to delete the 0th character, a.
A-kun deleted only the 0th character, a.
Sample 3
Input
nmnmnmnmnmnmnm 13 12
Output
nmnmnmnmnmnm
The last two characters are gone.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。