{"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":"MD","content":"你有一个只包含小写拉丁字母的字符串 $s$ 和 $q$ 次查询。\n\n每次查询只能是以下两种情况之一:\n\n- $1$ $pos$ $c$ $(1\\le pos\\le |s|, c 为小写拉丁字母)$:将 $s_{pos}$ 替换为 $c$。\n- $2$ $l$ $r$ $(1\\le l\\le r\\le |s|)$:计算并输出子段 $s[l;r]$ 中不同字母的种类。\n\n子段 $s[l;r]$ 即字符串 $s_{l}s_{l + 1}s_{l + 2}\\dots s_{r}$。"}},{"title":"输入","value":{"format":"MD","content":"第一行为字符串 $s(|s|\\le 10^5)$。\n\n第二行为一个整数 $q(1\\le q\\le 10^5)$。\n\n后续 $q$ 行,每行为一次查询,格式由题目描述给出。至少有一次第二类查询。"}},{"title":"输出","value":{"format":"MD","content":"对每个第一类查询,按要求更新字符串。\n\n对每个第二类查询,输出查询的结果。"}},{"title":"样例1","value":{"format":"MD","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\u003e\nsudaacm\n7\n2 2 5\n1 1 g\n1 2 o\n2 1 4\n1 3 o\n1 4 d\n2 1 4\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e\n3\n4\n3\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"样例2","value":{"format":"MD","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\u003e\nmeaninglessstring\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\u003e\n6\n3\n5\n3\n8\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}