Nenokku
Easy
Execution time limit is 3 seconds
Runtime memory usage limit is 64 megabytes
Each input line will contain one of the following two types of entries:
? <word> where <word> is a sequence of up to 50 Latin characters.
A <text> where <text> is a sequence of up to 10^5 Latin characters.
A line starting with ? is a query to check if the substring <word> exists in the current work.
A line starting with A indicates that <text> should be added to the current work.
The author is just beginning the work, so the total written content cannot exceed 10^5 characters. The input data will not exceed 15 megabytes in size.
Output
For each query line (type ?), output "YES" if the substring <word> is found in the work, and "NO" if it is not. The search should be case-insensitive.
Examples
Input #1
Answer #1
Submissions 3K
Acceptance rate 24%