{"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":"在第一个样例中,有6个好的子串:\n\u003cul\u003e\n\u003cli\u003es\u003csub\u003e1\u003c/sub\u003e...s\u003csub\u003e2\u003c/sub\u003e\u003c/li\u003e\n\u003cli\u003es\u003csub\u003e1\u003c/sub\u003e...s\u003csub\u003e4\u003c/sub\u003e\u003c/li\u003e\n\u003cli\u003es\u003csub\u003e1\u003c/sub\u003e...s\u003csub\u003e5\u003c/sub\u003e\u003c/li\u003e\n\u003cli\u003es\u003csub\u003e3\u003c/sub\u003e...s\u003csub\u003e4\u003c/sub\u003e\u003c/li\u003e\n\u003cli\u003es\u003csub\u003e3\u003c/sub\u003e...s\u003csub\u003e5\u003c/sub\u003e\u003c/li\u003e\n\u003cli\u003es\u003csub\u003e4\u003c/sub\u003e...s\u003csub\u003e5\u003c/sub\u003e\u003c/li\u003e\n\u003c/ul\u003e\n在第二个样例中,有3个好的子串:\n\u003cul\u003e\n\u003cli\u003es\u003csub\u003e1\u003c/sub\u003e...s\u003csub\u003e2\u003c/sub\u003e\u003c/li\u003e\n\u003cli\u003es\u003csub\u003e1\u003c/sub\u003e...s\u003csub\u003e3\u003c/sub\u003e\u003c/li\u003e\n\u003cli\u003es\u003csub\u003e2\u003c/sub\u003e...s\u003csub\u003e3\u003c/sub\u003e\u003c/li\u003e\n\u003c/ul\u003e\n"}}]}