{"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,S的长度\u003c\u003d3e5,S只有两个字符A或者B构成。定义一个字符串T是”好“的串,满足:对于每个位置,都有一个长度\u003e\u003d2的回文子串覆盖它。请你求出,S有多少个子串是”好“的。"}},{"title":"Input","value":{"format":"MD","content":"一个只有A,B构成的字符串S"}},{"title":"Output","value":{"format":"MD","content":"S有多少个子串是好的(提示C/C++/Pascal:开long long(int64),3e5*3e5会爆int(int32))"}},{"title":"Examples","value":{"format":"MD","content":"### Input\n5\nAABBB\n### Output\n6\n\n### Input\n3\nAAA\n### Output\n3\n\n### Input\n7\nAAABABB\n### Output\n15"}},{"title":"Note","value":{"format":"MD","content":"第一组样例:总共5*4/2\u003d10个子串,其中“ABB”,\"ABBB\",\"AAB\",\"AB\"是不合法的。故10-4\u003d6个。\n\n第二组样例:显然,都是合法的,3*2/2\u003d6个\n\n第三组样例:一共7*6/2\u003d21个子串,其中\"AAAB\",\"AAB\",\"AB\",\"BA\",\"AB\",\"ABB\",共6个不合法。答案为21-6\u003d15个。\n\n话说我是不是提示了你们什么呢~"}}]}