{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"给你一个只包含小写字母的字符串s.\u003c/br\u003e\n问你在这个字符串中有多少个不同的子串.\u003c/br\u003e\n且要求这些子串中不得出现超过k个的特殊字母.\u003c/br\u003e\n*子串s1和子串s2不同,当且仅当s1!\u003ds2,即s1和s2完全不同.\u003c/br\u003e\n*子串指的是字符串中截取出来的连续的一段.\u003c/br\u003e"}},{"title":"输入格式","value":{"format":"HTML","content":"第一行,一个长度不超过1500仅包含小写字母的字符串s.\u003c/br\u003e\n第二行,包含一个长度为26的01字符串,如果字符串的第i(0\u003c\u003di\u003c length(s))个位置为\u00270\u0027,说明\u0027a\u0027+i为特殊字母,否则\u0027a\u0027+i不是特殊字母.\u003c/br\u003e\n第三行,包含一个整数k(0\u003c\u003dk\u003c\u003d|s|)."}},{"title":"输出格式","value":{"format":"HTML","content":"只有一个整数,表示符合要求的不同子串的个数"}},{"title":"样例","value":{"format":"HTML","content":"\u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n样例输入1\n \u003c/div\u003e\n \u003cpre\u003eababab\u003cbr\u003e01000000000000000000000000\u003cbr\u003e1\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n样例输出1\n \u003c/div\u003e\n \u003cpre\u003e5\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n样例输入2\n \u003c/div\u003e\n \u003cpre\u003eacbacbacaa\u003cbr\u003e00000000000000000000000000\u003cbr\u003e2\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n样例输出2\n \u003c/div\u003e\n \u003cpre\u003e8\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}},{"title":"样例解释","value":{"format":"HTML","content":"对于第一个样例,符合要求的子串分别为:\"a\", \"ab\", \"b\", \"ba\", \"bab\"."}},{"title":"提示","value":{"format":"HTML","content":"不要局限自己的思路。"}}]}