{"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":"HTML","content":"\u003cp\u003e给定一个字符串 \u003cb\u003es\u003c/b\u003e,是一个合法的括号序列。我们打算对这个括号序列进行染色,有以下要求:\u003c/p\u003e\n\u003cul\u003e\n\t\u003cli\u003e 每个字符有三种情况:不染色,染成红色,染成蓝色 \u003c/li\u003e\n\t\u003cli\u003e 每对匹配的括号,有且仅有一个字符被染色 \u003c/li\u003e\n\t\u003cli\u003e 所有相邻的两个字符,不能染成同一种颜色 \u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e求满足要求的括号序列染色方案数,答案可能很大,输出答案对 \u003cb\u003e10\u003csup\u003e9\u003c/sup\u003e + 7\u003c/b\u003e 取模的结果。\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e输入只有一行一个字符串 \u003cb\u003es\u003c/b\u003e (\u003cb\u003e2 \u0026leq; |s| \u0026leq; 700\u003c/b\u003e),保证是合法的括号序列。\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e输出一个整数,为答案对 \u003cb\u003e10\u003csup\u003e9\u003c/sup\u003e + 7\u003c/b\u003e 取模的结果。\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003cdiv class\u003d\"sample-test\"\u003e \n \u003cdiv class\u003d\"input\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e \n \u003cpre\u003e(())\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e \n \u003cdiv class\u003d\"output\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e \n \u003cpre\u003e12\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e \n \u003cdiv class\u003d\"input\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e \n \u003cpre\u003e(()())\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e \n \u003cdiv class\u003d\"output\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e \n \u003cpre\u003e40\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e \n \u003cdiv class\u003d\"input\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e \n \u003cpre\u003e()\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e \n \u003cdiv class\u003d\"output\"\u003e \n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e \n \u003cpre\u003e4\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003e对于样例 1,下图是其中两种合法的染色方案:\u003c/p\u003e \n\u003ccenter\u003e \n \u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/4399a47b86d784c277acf53b136c6401?v\u003d1596554609\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e \n \u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/7a03d539d1d681eee4497cfa5c1ed684?v\u003d1596554609\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e \n\u003c/center\u003e \n\u003cp\u003e而下图中的染色方案则是非法的。\u003c/p\u003e \n\u003ccenter\u003e \n \u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/6e03de2eb570c8a20504c3d70355d50c?v\u003d1596554609\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e \n \u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/3fa44dba87152fc9c3181c54c2c20497?v\u003d1596554609\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e \n\u003c/center\u003e"}}]}