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

建议使用的浏览器:

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

7124:Kth Smallest Common Substring

题目描述
Given $n (1 \leq n \leq 10^5)$ strings containing only lowercase letters, you need to find out the $k$th smallest one among all the distinct common substrings of the $n$ strings.
输入解释
This problem contains multiple test cases.

The first line contains an integer $T$ ($1 \leq T \leq 20$) indicating the number of test cases.

For each test case, the first line of the input contains an integer $n (1 \leq n \leq 10^5)$ indicates the number of the strings.

Each of the next $n$ lines contains a string containing only lowercase letters.

The next line contains an integer $q$, the number of the queries.

Each of the next $q (1 \leq q \leq 10^5)$ lines contains an integer $k (1 \leq k \leq 10^7)$ represeting a query.

It is guaranteed that for each test case, the sum of the length of all strings is no more than $2 \times 10 ^ 5$.
输出解释
For each query, you need to give an interval $[l,r)$ indicating the first(leftmost) occurrence of the answer in the first string.

If the number of distinct common substrings is less than k, output $-1$ instead.
输入样例
1
5
abaaaa
aabaab
aabbba
aabaaa
abaabb
3
1
2
3
输出样例
0 1
2 4
0 2

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

源链接: HDU-7124

最后修改于 2021-10-23T19:11:35+00:00 由爬虫自动更新

共提交 0

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