#P10442. 「MYOI-R3」字符串
「MYOI-R3」字符串
Problem Description
Given strings .
Now you need to delete some characters in and reorder the remaining characters so that .
What is the maximum possible value of (i.e., the length of string ) after the operations?
Input Format
The first line contains a string .
The second line contains a string .
Output Format
Output one integer in one line, representing the maximum possible value of after the operations.
abc
bc
2
aaaaa
bbbbb
0
Hint
In the first sample, delete a and keep bc.
Then , and it can be proven that this is optimal.
In the second sample, delete aaaaa and keep the empty string.
Delete bbbbb and keep the empty string.
Then , and it can be proven that this is optimal.
This problem uses bundled testdata.
Let .
| Special Property | Total Score | ||
|---|---|---|---|
| None | |||
| None |
Constraints: For of the data, . Both strings consist of lowercase letters.
Special Property : is a permutation of .
Special Property : It is guaranteed that .
Translated by ChatGPT 5