QOJ.ac

QOJ

Limite de temps : 2 s Limite de mémoire : 1024 MB Points totaux : 100

#23873. 文字列の反転

Statistiques

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

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

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

入力

入力は以下の形式で標準入力から与えられる.

$$ \begin{aligned} &N \ A \ B \\ &S \end{aligned} $$

出力

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

制約

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

入出力例

入力 1

10 3 7
JOIjoiJoIj

出力 1

JOJiojIoIj

入力 2

9 6 6
abcdefghi

出力 2

abcdefghi

解説 2

  • $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.