String

TimeLimit:1000MS  MemoryLimit:65536KB
64-bit integer IO format:%I64d
未提交 | 登录后收藏
Problem Description
There is a string $S$.$S$ only contain lower case English character.$(10 \leq length(S) \leq 1,000,000)$
How many substrings there are that contain at least $k(1 \leq k \leq 26)$ distinct characters?
Input
There are multiple test cases. The first line of input contains an integer $T (1\leq T\leq 10)$ indicating the number of test cases. For each test case:

The first line contains string $S$.
The second line contains a integer $k(1 \leq k \leq 26)$.
Output
For each test case, output the number of substrings that contain at least $k$ dictinct characters.
SampleInput
2
abcabcabca
4
abcabcabcabc
3
SampleOutput
0
55
Submit
题目统计信息详细
总AC数8
通过人数6
尝试人数8
总提交量20
AC率30.00%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

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