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.