TopCoder

User's AC Ratio

NaN% (0/0)

Submission's AC Ratio

NaN% (0/0)

Tags

Description

Hmmmmmm…………strings again :) Then it must be an
easy task for you. Well……you are given with a string S of length not
more than 500,000 characters (only ‘a’-‘z’ and ‘A’ – ‘Z’). Then follows q (q
< 10,000
) queries where each query contains a string T of maximum
length 10,000 (also contains only ‘a’-‘z’ and ‘A’ – ‘Z’). You should determine
whether or not T is a substring of S.

Input Format

First line contains an integer k (k
< 10
) telling the number of test cases to follow. Each test case begins
with S. It is followed by q. After this line there are q

lines each of which has a string T as defined before.


The size of input file is less than 10MB.

Output Format

For each query print ‘y’ if it is a substring
of S or ‘n’ otherwise followed by a new line. See the sample output
below.

Sample Input 1

2
abcdefghABCDEFGH
2
abc
abAB
xyz
1
xyz

Sample Output 1

y
n
y

Hints

被雷到可能會影響您的身心健康,ACM2009培訓班關心您。(按我繼續)

Problem Source

Migrated from old NTUJ.

UVa 10679

Subtasks

No. Testdata Range Score

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 10000 65536 2048