시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 | 256 MB | 2 | 0 | 0 | 0.000% |
You have an initial string S = [s1, …, sn].
By definition, Sx,y is a part of string S as follows:
You are given m queries of several types:
Note that the value of n will change on modification queries of type (c).
Write a program that runs the queries above.
Q i j
where 1 ≤ i ≤ j ≤ n.M 1 i j k
– Modifcation query (a), where i ≤ j.M 2 i j
– Modification query (b), where i ≤ j.M 3 i c
– Modification query (c), where c is a character.You can assume that the string will contain only lowercase characters of the English alphabet at all times.
You may assume that the input is valid.
For each question query, output a single line of "YES" or "NO" (without quotes).
6 10 banana Q 2 6 Q 2 5 M 2 2 3 Q 2 5 M 2 5 6 Q 1 6 M 3 7 b Q 1 7 M 1 1 2 4 Q 4 7
YES NO YES NO YES NO
The modification queries will change the string in the following way:
banana
bnaana
bnaaan
bnaaanb
aaanbnb