当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5507:GT and strings

题目描述
You are given $N$ strings.Their total length is $L$.

There are $Q$ questions.

For each question please work out two tasks:

①whether $S_x$ is a subsequence of $S_y$.

②whether $S_x$ is a substring of $S_y$.

If the statement is true print $1$,otherwise print $0$
输入解释
In the first line there is the testcase $T$.

For each teatcase:

In the first line there are two numbers $N$ and $Q$.

In the next $N$ lines there are $N$ strings $i$-th line is a string standing for $S_i$.

**Note that $S_i$ consists of only lower alphabets.**

In the last $Q$ lines there are two numbers$ (x,y)$.

$T \leq 5$。$N,L,Q \leq 100000$。Every string's length is at least $1$。

There are $60\%$ testcases that $L \leq 100$,$Q \leq 1000$。

You'd better print the enter in the last line when you hack others.

You'd better not print space in the last of each line when you hack others.
输出解释
For each testcase,print only one lines.

It's a string contains only $0$ and $1$ and its length is $Q*2$.

$i*2-1$-th character is the answer of the $i$-th question of ①,

and $i*2$-th character is the answer of the $i$-th question of ②。
输入样例
1
6 6
orz
stilwell
skydec
se
dec
orz
1 2
1 3
1 6
4 1
4 2
6 1
输出样例
000011001011
来自杭电HDUOJ的附加信息
Recommend hujie

该题目是Virtual Judge题目,来自 杭电HDUOJ

题目来源 BestCoder Round #60

源链接: HDU-5507

最后修改于 2020-10-25T23:23:15+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
4000/2000MS(Java/Others) 262144/262144K(Java/Others)