QOJ.ac

QOJ

Límite de tiempo: 2 s Límite de memoria: 1024 MB Puntuación total: 100

#23873. 字串反轉

Estadísticas

畀定長度為 $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.