{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n section pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"Problem Statement","value":{"format":"MD","content":"给定一个仅包含小写字母的字符串 S。\n有 N 种操作,你可以以任意顺序执行操作且每种操作可以执行任意次。\n第 i 种操作将区间 [L_i,R_i] 的字母变为它在字母表中的后继(z 的后继为 a)。\n求是否可以将 S 变为一个回文串。\n"}},{"title":"Constraints","value":{"format":"MD","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cul\u003e \n \u003cli\u003e\u003cvar\u003e\\(1 \\leq |S| \\leq 10^5\\)\u003c/var\u003e\u003c/li\u003e \n \u003cli\u003e\u003cvar\u003e\\(S\\)\u003c/var\u003e consists of lowercase English letters.\u003c/li\u003e \n \u003cli\u003e\u003cvar\u003e\\(1 \\leq N \\leq 10^5\\)\u003c/var\u003e\u003c/li\u003e \n \u003cli\u003e\u003cvar\u003e\\(1 \\leq L_i \\leq R_i \\leq |S|\\)\u003c/var\u003e\u003c/li\u003e \n\u003c/ul\u003e"}},{"title":"Input","value":{"format":"MD","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cp\u003eInput is given from Standard Input in the following format:\u003c/p\u003e \n\u003cpre\u003e\u003cvar\u003e\\(S\\)\u003c/var\u003e\n\u003cvar\u003e\\(N\\)\u003c/var\u003e\n\u003cvar\u003e\\(L_1\\)\u003c/var\u003e \u003cvar\u003e\\(R_1\\)\u003c/var\u003e\n\u003cvar\u003e\\(L_2\\)\u003c/var\u003e \u003cvar\u003e\\(R_2\\)\u003c/var\u003e\n\u003cvar\u003e\\(:\\)\u003c/var\u003e\n\u003cvar\u003e\\(L_N\\)\u003c/var\u003e \u003cvar\u003e\\(R_N\\)\u003c/var\u003e\n\u003c/pre\u003e"}},{"title":"Output","value":{"format":"MD","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cp\u003ePrint \u003ccode\u003eYES\u003c/code\u003e if it is possible to turn \u003cvar\u003e\\(S\\)\u003c/var\u003e into a palindrome; print \u003ccode\u003eNO\u003c/code\u003e if it is impossible.\u003c/p\u003e"}},{"title":"Sample Input 1","value":{"format":"MD","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003ebixzja\n2\n2 3\n3 6\n\u003c/pre\u003e"}},{"title":"Sample Output 1","value":{"format":"MD","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003eYES\n\u003c/pre\u003e \n\u003cp\u003eFor example, if we perform Operation \u003cvar\u003e\\(1\\)\u003c/var\u003e, \u003cvar\u003e\\(2\\)\u003c/var\u003e and \u003cvar\u003e\\(1\\)\u003c/var\u003e in this order, \u003cvar\u003e\\(S\\)\u003c/var\u003e changes as \u003ccode\u003ebixzja\u003c/code\u003e → \u003ccode\u003ebjyzja\u003c/code\u003e → \u003ccode\u003ebjzakb\u003c/code\u003e → \u003ccode\u003ebkaakb\u003c/code\u003e and becomes a palindrome.\u003c/p\u003e"}},{"title":"Sample Input 2","value":{"format":"MD","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003eabc\n1\n2 2\n\u003c/pre\u003e"}},{"title":"Sample Output 2","value":{"format":"MD","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003eNO\n\u003c/pre\u003e"}},{"title":"Sample Input 3","value":{"format":"MD","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003ecassert\n4\n1 2\n3 4\n1 1\n2 2\n\u003c/pre\u003e"}},{"title":"Sample Output 3","value":{"format":"MD","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003eYES\n\u003c/pre\u003e"}}]}