Orange Boy Can You Solve It Out? Ep. 61
思考题 featuring Hikari again!
Guess the string
Hikari and her master Ninetail are playing a game. Hikari thinks of a string with lower-case letters, and Ninetail asks her to make modifications one by one. Each modification can only be one of the following two forms:
- append itself to the back of the string. For example
aabbc
will turn intoaabbcaabbc
after this operation. -
Given , get the substring from the L-th character to the R-th character inclusive. For example,
aabbc
with will getabb
. It is made sure that the range will not be out of bound.
It is known that after all these operations, the final string is . Find any that satisfies the condition, or report impossible. (Note that if in operation 2 the indices are out of bound, such is considered illegal).
You do not need to minimize the length of .
Example
Input:
Queries=[{1},{2,L=1,R=3},{1},{2,L=1,R=4}]
T="abaa"
Output:
S="ab"
Explanation:
ab->abab->aba->abaaba->abaa
Input:
Queries=[{2,L=1,R=3},{1},{2,L=1,R=7},{1}]
T="abcdefgabcdefg"
Output:
Impossible
Limitations
For 80%,
For 100%,
版权声明:
作者:XGN
链接:https://blog.hellholestudios.top/archives/1566
来源:Hell Hole Studios Blog
文章版权归作者所有,未经允许请勿转载。
Example
共有 0 条评论