{"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\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\n\u003cp\u003eZayin最近学会了如何计算字符串的周期数。\u003c/p\u003e\n\u003cp\u003e作为他的女朋友,Ziyin想给Zayin一些字符串,测试他是否真的学会了这个知识。但是Ziyin太懒了,不想生成完全不同的字符串,所以她首先会给Zayin一个字符串,并问他如果她将字符串的第$$$i$$$个字符修改为\u003cspan class\u003d\"tex-font-style-tt\"\u003e#\u003c/span\u003e,新字符串的周期数是多少。(注意,Ziyin不会真正执行修改操作)\u003c/p\u003e\n\u003cp\u003e这对Zayin来说真是一个大问题。你能帮助他,让他不至于在女朋友面前丢脸吗?\u003c/p\u003e\n"}},{"title":"输入","value":{"format":"HTML","content":"\u003cp\u003e第一行包含一个字符串$$$s$$$($$$1\\le|s|\\le 10^6$$$),其中只包含小写字母。\u003c/p\u003e\n\u003cp\u003e第二行包含一个整数$$$q$$$($$$1\\le q\\le 10^6$$$),表示查询的次数。\u003c/p\u003e\n\u003cp\u003e接下来的$$$q$$$行中,每行包含一个整数$$$i\\ (1\\le i\\le |s|)$$$,表示Ziyin将字符串的第$$$i$$$个字符修改为\u003cspan class\u003d\"tex-font-style-tt\"\u003e#\u003c/span\u003e。\u003c/p\u003e"}},{"title":"输出","value":{"format":"HTML","content":"\u003cp\u003e对于每个查询,输出一个整数,表示Ziyin修改后的新字符串的周期数。\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\u003eccpc\n4\n1\n2\n3\n4\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0\n1\n1\n0\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"注意","value":{"format":"HTML","content":"\u003cp\u003e对于一个字符串$$$s$$$,如果且仅当$$$1\\le T\u0026lt;|s|$$$且对于每个$$$i\\in\\big(T,|s|\\big]$$$,有$$$s[i]\u003ds[i-T]$$$,那么整数$$$T$$$就是字符串$$$s$$$的周期数。\u003c/p\u003e"}}]}