{"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":"\n\u003cp\u003e给定一个由小写英文字母组成的字符串$$$s$$$和$$$q$$$个关于该字符串的查询。\u003c/p\u003e\n\n\u003cp\u003e有两种类型的查询:\u003c/p\u003e\n\u003cul\u003e\n \u003cli\u003e$$$1~ pos~ c$$$($$$1 \\le pos \\le |s|$$$,$$$c$$$是小写英文字母):将$$$s_{pos}$$$替换为$$$c$$$(设置$$$s_{pos} :\u003d c$$$);\u003c/li\u003e\n \u003cli\u003e$$$2~ l~ r$$$($$$1 \\le l \\le r \\le |s|$$$):计算子串$$$s[l\\ldots r]$$$中不同字符的数量。\u003c/li\u003e\n\u003c/ul\u003e\n"}},{"title":"输入","value":{"format":"HTML","content":"\u003cp\u003e输入的第一行包含一个字符串$$$s$$$,由不超过$$$10^5$$$个小写英文字母组成。\u003c/p\u003e\n\u003cp\u003e输入的第二行包含一个整数$$$q$$$($$$1 \\le q \\le 10^5$$$)——查询的数量。\u003c/p\u003e\n\u003cp\u003e接下来的$$$q$$$行包含查询,每行一个查询。每个查询的格式如问题描述中所述。\u003c/p\u003e"}},{"title":"输出","value":{"format":"HTML","content":"\u003cp\u003e对于每个第二类型的查询,输出其答案——子串$$$s[l\\ldots r]$$$中不同字符的数量。\u003c/p\u003e"}},{"title":"示例1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003e输入\u003c/th\u003e\n \u003cth\u003e输出\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003eacbabcba\n6\n2 1 8\n2 4 6\n1 2 b\n2 1 3\n1 1 b\n2 1 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\n3\n2\n1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"示例2","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003e输入\u003c/th\u003e\n \u003cth\u003e输出\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003eabecdabfebdaabfdab\n18\n1 5 f\n1 3 a\n2 5 13\n1 8 c\n1 11 b\n2 5 9\n2 2 7\n1 6 d\n1 3 e\n1 9 b\n2 8 10\n1 9 b\n1 13 c\n1 1 d\n2 3 13\n2 3 8\n2 5 9\n2 1 18\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e5\n5\n4\n2\n6\n5\n4\n6\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}