{"trustable":true,"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\u003eBạn được cho một chuỗi $$$s$$$ bao gồm các chữ cái Latin thường và $$$q$$$ truy vấn cho chuỗi này.\u003c/p\u003e\u003cp\u003eNhớ rằng chuỗi con $$$s[l; r]$$$ của chuỗi $$$s$$$ là chuỗi $$$s_l s_{l + 1} \\dots s_r$$$. Ví dụ, các chuỗi con của \"\u003cspan class\u003d\"tex-font-style-tt\"\u003ecodeforces\u003c/span\u003e\" là \"\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\", nhưng không phải \"\u003cspan class\u003d\"tex-font-style-tt\"\u003ecoder\u003c/span\u003e\" và \"\u003cspan class\u003d\"tex-font-style-tt\"\u003etop\u003c/span\u003e\".\u003c/p\u003e\u003cp\u003eCó hai loại truy vấn: \u003c/p\u003e\u003cul\u003e \u003cli\u003e $$$1~ pos~ c$$$ ($$$1 \\le pos \\le |s|$$$, $$$c$$$ là chữ cái Latin thường): thay thế $$$s_{pos}$$$ bằng $$$c$$$ (đặt $$$s_{pos} :\u003d c$$$); \u003c/li\u003e\u003cli\u003e $$$2~ l~ r$$$ ($$$1 \\le l \\le r \\le |s|$$$): tính số ký tự phân biệt trong chuỗi con cần thiết $$$s[l; r]$$$. \u003c/li\u003e\u003c/ul\u003e"}},{"title":"Nhập","value":{"format":"HTML","content":"\u003cp\u003eDòng đầu tiên của đầu vào chứa một chuỗi $$$s$$$ bao gồm không quá $$$10^5$$$ chữ cái Latin thường.\u003c/p\u003e\u003cp\u003eDòng thứ hai của đầu vào chứa một số nguyên $$$q$$$ ($$$1 \\le q \\le 10^5$$$) — số lượng truy vấn.\u003c/p\u003e\u003cp\u003eCác dòng tiếp theo chứa các truy vấn, mỗi truy vấn trên một dòng. Mỗi truy vấn được đưa ra theo định dạng mô tả trong câu hỏi. Đảm bảo rằng có ít nhất một truy vấn của loại thứ hai.\u003c/p\u003e"}},{"title":"Đầu ra","value":{"format":"HTML","content":"\u003cp\u003eĐối với mỗi truy vấn loại thứ hai, in câu trả lời cho nó — số lượng ký tự phân biệt trong chuỗi con cần thiết trong truy vấn này.\u003c/p\u003e"}},{"title":"Ví dụ 1","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":"Ví dụ 2","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"}}]}