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} $$

출력

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