题号:NC219810
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 512 M,其他语言1024 M
64bit IO Format: %lld
题目描述
You are given two strings

and

consist of lowercase letters. The length of

and

are both

.
You have to perform

queries. Each query has one of three types:
输入描述:
The first line contains two integers

and
_%7B%7D)
— the length of two strings and the number of queries.
The second line and third line contain two strings

and

of length

.
Next

lines contain queries (one per line), each query has one of three types described above.
It is guaranteed that there is at least one query of the third type.
输出描述:
For each third type of query, output an integer representing the length of the longest common prefix of strings
and
.
示例1
输入
复制
6 5
aazaaa
abcbaa
3
2 2 4
3
1 3 c
3