CF666E Forensic Examination
Description
给你一个串\(S\)以及一个字符串数组\(T[1..m]\),\(q\)次询问,每次问\(S\)的子串\(S[p_l..p_r]\)在\(T[l..r]\)中的哪个串里的出现次数最多,并输出出现次数。
如有多解输出最靠前的那一个。
Input Format
The first line contains the string $ s $ ( $ 1<=|s|<=5·10^{5} $ ) — the Absolutely Inadmissible Swearword. The string $ s $ consists of only lowercase English letters.
The second line contains the only integer $ m $ ( $ 1<=m<=5·10^{4} $ ) — the number of texts of leaflets for expertise.
Each of the next $ m $ lines contains the only string $ t_{i} $ — the text of the $ i $ -th leaflet. The sum of lengths of all leaflet texts doesn't exceed $ 5·10^{4} $ . The text of the leaflets consists of only lowercase English letters.
The next line contains integer $ q $ ( $ 1<=q<=5·10^{5} $ ) — the number of queries for expertise.
Finally, each of the last $ q $ lines contains four integers $ l $ , $ r $ , $ p_{l} $ , $ p_{r} $ ( $ 1<=l<=r<=m,1<=p_{l}<=p_{r}<=|s| $ ), where $ |s| $ is the length of the Absolutely Inadmissible Swearword.
来源:https://www.cnblogs.com/Parsnip/p/12202952.html