QOJ.ac

QOJ

시간 제한: 2 s 메모리 제한: 1024 MB 총점: 100

#23873. Inversion of a String

통계

問題文

長さ $N$ の文字列 $S$ が与えられる.

$S$ の $A$ 文字目から $B$ 文字目までの文字の並びを逆にし,それ以外の文字はそのままにしたとき,どのような文字列ができるだろうか.ただし,$S$ の先頭の文字が $1$ 文字目,末尾の文字が $N$ 文字目である.

文字列 $S$ と,$2$ つの整数 $A, B$ が与えられたとき,$S$ のうち $A$ 文字目から $B$ 文字目までの文字の並びを逆にしてできる文字列を出力するプログラムを作成せよ.

制約

  • $1 ≦ A ≦ B ≦ N ≦ 200$.
  • $S$ は長さ $N$ の文字列である.
  • $S$ の各文字は英大文字または英小文字である.

入力

入力は以下の形式で標準入力から与えられる.
$N$ $A$ $B$
$S$

出力

$S$ のうち $A$ 文字目から $B$ 文字目までの文字の並びを逆にしてできる文字列を $1$ 行で出力せよ.

入出力例

入力例 1
10 3 7
JOIjoiJoIj

出力例 1
JOJiojIoIj


入力例 2
9 6 6
abcdefghi

出力例 2
abcdefghi

  • $A = B$ かもしれない.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.