Almost Periodic String
Time limit2sMemory limit512 MB
For each query, decide whether the substring S[l..r] can be turned into a string of period t by changing at most one character.
- Level
Hard8 of 10
- Topics
- String, Hash map, Prefix sum, Implementation
- Solved
- No attempts yet
Problem
You are given a string . Answer queries about this string . In the -th query, you may change up to one character in . Determine whether can be made into a string of period . Here denotes the substring of from the -th character to the -th character.
A string is a string of period if for every .
Input
The input is given from standard input in the following format.
Output
Output lines. The -th line must contain the answer to the -th query as Yes or No.
Constraints
- consists only of lowercase English letters