QOJ.ac

QOJ

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

#23873. 字符串的反转

통계

给定长度为 $N$ 的字符串 $S$。

将 $S$ 的第 $A$ 个字符到第 $B$ 个字符的排列顺序反转,其余字符保持原样,会得到怎样的字符串呢?其中,$S$ 开头的字符为第 $1$ 个字符,末尾的字符为第 $N$ 个字符。

给定字符串 $S$ 和 $2$ 个整数 $A, B$,请编写一个程序,输出将 $S$ 中第 $A$ 个字符到第 $B$ 个字符的排列顺序反转后得到的字符串。

输入格式

输入从标准输入按以下格式给出:

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

输出格式

在 $1$ 行内输出将 $S$ 中第 $A$ 个字符到第 $B$ 个字符的排列顺序反转后得到的字符串。

数据范围

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