Boring count

TimeLimit:1000MS  MemoryLimit:32768KB
64-bit integer IO format:%I64d
未提交 | 登录后收藏
Problem Description
You are given a string S consisting of lowercase letters, and your task is counting the number of substring that the number of each lowercase letter in the substring is no more than K.
Input
In the first line there is an integer T , indicates the number of test cases.
For each case, the first line contains a string which only consist of lowercase letters. The second line contains an integer K.

[Technical Specification]
1<=T<= 100
1 <= the length of S <= 100000
1 <= K <= 100000
Output
For each case, output a line contains the answer.
SampleInput
3
abc
1
abcabc
1
abcabc
2
SampleOutput
6
15
21
Submit
题目统计信息详细
总AC数5
通过人数5
尝试人数6
总提交量8
AC率62.50%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: