#ABC477C. 区间查找询问 / Range Search Query
区间查找询问 / Range Search Query
Problem Statement
You are given strings and . Process queries. In each query, you are given and . Determine whether the substring of consisting of the -th through -th characters contains as a substring.
What is a substring? A substring of is a string obtained by deleting zero or more characters from the beginning and zero or more characters from the end of . For example, ab is a substring of abc, but ac is not a substring of abc.
Constraints
- is a string of length between and , inclusive, consisting of lowercase English letters.
- is a string of length between and , inclusive, consisting of lowercase English letters.
- are integers.
Input
The input is given from Standard Input in the following format:
Each query is given in the following format:
Output
Output lines. The -th line should contain Yes if, for the -th query, the substring of consisting of the -th through -th characters contains as a substring, and No otherwise.
3
abcdabc
bc
2 6
3 5
3 7
Yes
No
Yes
Consider the first query. The substring of consisting of the -nd through -th characters is bcdab. The substring of bcdab consisting of the -st through -nd characters matches , so bcdab contains . Thus, the answer is Yes.
10
bbbaaabbbaaaaaabbbab
bbb
5 16
5 6
2 16
6 7
17 19
3 7
7 16
7 20
17 19
2 6
Yes
No
Yes
No
No
No
Yes
Yes
No
No
- Source: AtCoder ABC 477 C
相关
在下列比赛中: