Orange Boy Can You Solve It Out? Ep. 33
思考题 Times
A shadow pokemon!
Recently the famous game Pokemon SwordString was released. XGN, one of the biggest fan of Pokemon, decided to have a try.
In each battle, your Pokemon can be seen as a string A and the enemy can be seen as a string B. One can make a critical hit if B is a substring of A.
XGN can weaken the foe first. He can remove a character from B each turn.
What's the minimum turn of weakening to make a critical hit?
Sample
Example 1
In
A=eevee
B=eveee
Output
1
Explain
Remove the last 'e' in B and B will be a substring of A
Example 2
In
A=pikachu
B=reshiram
Output
7
Explain
Screenshot from Pokemon Essentials
Constriants
Subtask 1(20%):|A|,|B|<=20
Subtask 2(40%):|A|,|B|<=1000
Subtask 3(40%):|A|,|B|<=100000
Is it really good to release 2 simple questions at once?
版权声明:
作者:XGN
链接:https://blog.hellholestudios.top/archives/336
来源:Hell Hole Studios Blog
文章版权归作者所有,未经允许请勿转载。
共有 0 条评论