#abc314d. D - LOWER
D - LOWER
Score : points
问题描述
你得到一个长度为 的字符串 ,由大小写英文字母组成。
现在要在字符串 上执行 次操作。第 次操作 由一个包含两个整数和一个字符的元组 表示,如下所示:
- 若 ,将 中的第 个字符改为 。
- 若 ,将 中所有大写字母转换为小写(此操作不使用 )。
- 若 ,将 中所有小写字母转换为大写(此操作不使用 )。
输出经过 次操作后的字符串 。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given a string of length consisting of uppercase and lowercase English letters.
Let us perform operations on the string . The -th operation is represented by a tuple of two integers and one character, as follows.
- If , change the -th character of to .
- If , convert all uppercase letters in to lowercase (do not use for this operation).
- If , convert all lowercase letters in to uppercase (do not use for this operation).
Print the after the operations.
Constraints
- is a string of length consisting of uppercase and lowercase English letters.
- If , then .
- is an uppercase or lowercase English letter.
- If , then and
'a'
. - are all integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer in a single line.
Sample Input 1
7
AtCoder
5
1 4 i
3 0 a
1 5 b
2 0 a
1 4 Y
Sample Output 1
atcYber
Initially, the string is AtCoder
.
- The first operation changes the -th character to
i
, changing toAtCider
. - The second operation converts all lowercase letters to uppercase, changing to
ATCIDER
. - The third operation changes the -th character to
b
, changing toATCIbER
. - The fourth operation converts all uppercase letters to lowercase, changing to
atciber
. - The fifth operation changes the -th character to
Y
, changing toatcYber
.
After the operations, the string is atcYber
, so print atcYber
.
Sample Input 2
35
TheQuickBrownFoxJumpsOverTheLazyDog
10
2 0 a
1 19 G
1 13 m
1 2 E
1 21 F
2 0 a
1 27 b
3 0 a
3 0 a
1 15 i
Sample Output 2
TEEQUICKBROWMFiXJUGPFOVERTBELAZYDOG
update @ 2024/3/10 08:58:20