{"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":"\u003cp\u003e给定一个字符串 $$$s$$$,由小写拉丁字母组成。对于该字符串,有 $$$q$$$ 个查询。\u003c/p\u003e\n\n\u003cp\u003e回想一下,字符串 $$$s$$$ 的子串 $$$s[l; r]$$$ 是指字符串 $$$s_l s_{l + 1} \\dots s_r$$$。\u003cbr\u003e例如,\"\u003cspan class\u003d\"tex-font-style-tt\"\u003ecodeforces\u003c/span\u003e\" 的子串有 \"\u003cspan class\u003d\"tex-font-style-tt\"\u003ecode\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eforce\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003ef\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003efor\u003c/span\u003e\",但不包括 \"\u003cspan class\u003d\"tex-font-style-tt\"\u003ecoder\u003c/span\u003e\" 和 \"\u003cspan class\u003d\"tex-font-style-tt\"\u003etop\u003c/span\u003e\"。\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; r]$$$ 中不同字符的数量。 \u003c/li\u003e\n\u003c/ul\u003e"}},{"title":"输入","value":{"format":"HTML","content":"\u003cp\u003e第一行包含一个字符串 $$$s$$$,由不超过 $$$10^5$$$ 个小写拉丁字母组成。\u003c/p\u003e\n\n\u003cp\u003e第二行包含一个整数 $$$q$$$ $$$(1 \\le q \\le 10^5)$$$,表示查询的数量。\u003c/p\u003e\n\n\u003cp\u003e接下来的 $$$q$$$ 行,每行对应一个查询。每个查询的格式如题目描述。保证至少存在 1 个第二类型的查询。\u003c/p\u003e"}},{"title":"输出","value":{"format":"HTML","content":"\u003cp\u003e对于每个第二类型的查询,输出其答案:在该查询要求的子串中,不同字符的数量。\u003c/p\u003e"}},{"title":"示例","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\u003eabacaba\n5\n2 1 4\n1 4 b\n1 5 b\n2 4 6\n2 1 7\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\n1\n2\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"","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\u003edfcbbcfeeedbaea\n15\n1 6 e\n1 4 b\n2 6 14\n1 7 b\n1 12 c\n2 6 8\n2 1 6\n1 7 c\n1 2 f\n1 10 a\n2 7 9\n1 10 a\n1 14 b\n1 1 f\n2 1 11\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e5\n2\n5\n2\n6\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}