{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"Many people like to solve hard puzzles some of which may lead them to madness. One such puzzle could be finding a hidden prime number in a given text. Such number could be the number of different substrings of a given size that exist in the text. As you soon will discover, you really need the help of a computer and a good algorithm to solve such a puzzle. \n\u003cbr\u003eYour task is to write a program that given the size, N, of the substring, the number of different characters that may occur in the text, NC, and the text itself, determines the number of different substrings of size N that appear in the text. \n\u003cbr\u003eAs an example, consider N\u003d3, NC\u003d4 and the text \"daababac\". The different substrings of size 3 that can be found in this text are: \"daa\"; \"aab\"; \"aba\"; \"bab\"; \"bac\". Therefore, the answer should be 5. \n\u003cbr\u003e\u003cbr\u003e\n许多人喜欢解决困难的谜题,其中一些可能会导致他们疯狂。其中一个难题可能是在给定的文本中找到一个隐藏的质数。这个数字可以是文本中存在的给定大小的不同子字符串的数量。你很快就会发现,你真的需要电脑的帮助和一个好的算法来解决这样的难题。\n\u003cbr\u003e\n\n你的任务是编写一个程序,给定子字符串的大小N,文本中可能出现的不同字符的数量,NC,以及文本本身,确定文本中出现的大小为N的不同子字符串的数量。\n\u003cbr\u003e\n\n\n例如,考虑N\u003d3, NC\u003d4和文本“daababac”。在这个文本中可以找到大小为3的不同子字符串:“daa”;“aab”;“aba”;“bab”;“bac”。因此,答案应该是5。\u003cbr\u003e\n\n"}},{"title":"Input","value":{"format":"HTML","content":"The first line of input consists of two numbers, N and NC, separated by exactly one space. This is followed by the text where the search takes place. You may assume that the maximum number of substrings formed by the possible set of characters does not exceed 16 Millions. \u003cbr\u003e\u003cbr\u003e\n输入的第一行由两个数字N和NC组成,它们之间仅用一个空格隔开。后面是搜索发生的文本。您可以假设由可能的字符集组成的子字符串的最大数量不超过1600万。"}},{"title":"Output","value":{"format":"HTML","content":"The program should output just an integer corresponding to the number of different substrings of size N found in the given text. \u003cbr\u003e\u003cbr\u003e\n程序应该只输出一个整数,对应给定文本中大小为N的不同子字符串的数量。"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3 4\ndaababac\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e5\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"HTML","content":"Huge input,scanf is recommended."}}]}