ADACLEAN - Ada and Spring Cleaning
Ada the Ladybug has decided to do some "Spring Cleaning". As you might know, she keeps a TODO list. She is very sparing so she keeps all her activities as one string. You might get very confused while reading the string but she has a system - every activity has length exactly K characters. Sadly, as new activities were added to the list many duplicities appeared. Now it is time to find out how many unique activities are in her TODO list.
Input
First line contains T, number of test-cases.
Each test-case begins with N, K, 1 ≤ K ≤ N ≤ 105, length of string and length of activities respectively.
Next line consists of string of length N, consisting of lowercase letters.
The sum of lengths of strings among all test-cases won't exceed 3*105
Output
For each test-case, print the number of unique substrings of length K
Example Input
5 3 2 aaa 5 1 abcba 4 2 abac 10 2 abbaaaabba 7 3 dogodog
Example Output
1 3 3 4 4
hide comments
Khanh Ninh:
2017-01-04 04:22:30
Thank for the help ! I got AC :D |
|
morass:
2017-01-03 21:58:53
@Khanh Ninh:
|
|
Khanh Ninh:
2017-01-03 15:04:46
Hi, I'm having an unknown WA too, may you check the code? ID:18506949 |
|
morass:
2016-10-30 00:28:15
@Palashvijay4O: Good day to you - you are failing some "big" test-cases. Your answer are "lower" and when I change modulo the answers changes too.
|
|
Palashvijay4O:
2016-10-29 23:29:05
getting WA.. dont know what's the issue.
|
|
morass:
2016-10-11 21:24:51
@asshole: Asctivities are not one after another - they overlap, so there are N-K+1 activities in a string :) |
|
asshole:
2016-10-11 19:43:25
I don't understand the question. since each activity is of k length shouldn't there the string length be multiple of k?
|
|
mehmetin:
2016-09-11 16:19:23
Accepted with PYPY, but WA with C++14... |
|
Vipul Srivastava:
2016-09-11 09:23:03
what is the expected complexity of the solution? |
|
it_is_me:
2016-09-10 21:00:51
Getting WA constantly anybody can please provide me a good test case to check my solution.
|
Added by: | Morass |
Date: | 2016-09-06 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 GOSU |