QOJ.ac

QOJ

حد الوقت: 2 s حد الذاكرة: 1024 MB مجموع النقاط: 100

#23873. Đảo ngược xâu

الإحصائيات

Cho một xâu $S$ có độ dài $N$.

Nếu ta đảo ngược thứ tự các ký tự từ ký tự thứ $A$ đến ký tự thứ $B$ của $S$ và giữ nguyên các ký tự còn lại thì sẽ thu được xâu như thế nào? Lưu ý rằng ký tự đầu tiên của $S$ là ký tự thứ $1$ và ký tự cuối cùng là ký tự thứ $N$.

Khi được cho xâu $S$ và $2$ số nguyên $A, B$, hãy viết chương trình in ra xâu thu được sau khi đảo ngược thứ tự các ký tự từ ký tự thứ $A$ đến ký tự thứ $B$ của $S$.

Dữ liệu vào

Dữ liệu vào được cung cấp từ đầu vào chuẩn theo định dạng sau:

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

Dữ liệu ra

Hãy in ra trên $1$ dòng xâu thu được sau khi đảo ngược thứ tự các ký tự từ ký tự thứ $A$ đến ký tự thứ $B$ của $S$.

Ràng buộc

  • $1 \le A \le B \le N \le 200$.
  • $S$ là xâu có độ dài $N$.
  • Mỗi ký tự của $S$ là một chữ cái tiếng Anh viết hoa hoặc viết thường.

Ví dụ

Dữ liệu vào 1

10 3 7
JOIjoiJoIj

Dữ liệu ra 1

JOJiojIoIj

Dữ liệu vào 2

9 6 6
abcdefghi

Dữ liệu ra 2

abcdefghi

Giải thích 2

  • Có thể xảy ra trường hợp $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.