Orange Boy Can You Solve It Out? Ep. 49
思考题 so easy just to prove I am not dead
Wulpit is a divine fox spirit. She is learning Chinese. So she doesn't understand English.
One day she received an English string S of n lower case characters. XGN told her how her name would be like in English - T. Let's say that a sequence of characters x is Relevant if:
- x is a subtring of S
- the number of suffixes of x whose prefix is T is K. In other word, T occurs exactly K times in x. (overlapping allowed)
Now she wants to know the m-th longest relevant string. If there are many, print any.
S="wulwulsswul" K=2 T="wul" m=2
Explain: All relevant strings are:
As this problem might be so easy:
For 100% task 1 \leq n,|T| \leq 10^5, 1 \leq m \leq 10^9, 0 \leq k \leq n
来源：Hell Hole Studios Blog
共有 0 条评论