编程介的小学生 2019-08-21 21:56 采纳率: 20.5%
浏览 103

C语言的代码编写,Jinkeloid

Problem Description
After listening several songs of Jinkeloid,I come up with this problem :).
There is a string s only consist of first 20 lowercase English letters.
And we have several queries,each time I have k letters c1, c2, ..., ck,and I wonder how many consecutive substring of string s that each ci has occur even times in it.
Two substring with the same content but different position are considered different.

Input
The first line contains integer T(1<=T<=5),denote the number of the test cases.
For each test cases,the first line contains a string s(1<= length of s <= 105),the second line contains a number Q (Q<= 3 * 104),denote the number of queries.
Then Q lines follows,each lines start with a number k(1<= k<= 5),then contains k lowercase English letters c1, c2, ..., ck(There won't be duplicated ci).

Output
For each query,print the answer in one line.

Sample Input
1
cacca
5
3 c a b
2 c b
2 a b
3 c b a
2 a b

Sample Output
2
7
6
2
6

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 TYPCE母转母,插入认方向
    • ¥15 如何用python向钉钉机器人发送可以放大的图片?
    • ¥15 vue3加ant-design-vue无法渲染出页面
    • ¥15 matlab(相关搜索:紧聚焦)
    • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
    • ¥15 路易威登官网 里边的参数逆向
    • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
    • ¥50 需求一个up主付费课程
    • ¥20 模型在y分布之外的数据上预测能力不好如何解决
    • ¥15 processing提取音乐节奏