{"id":948,"date":"2014-08-26T12:07:19","date_gmt":"2014-08-26T04:07:19","guid":{"rendered":"http:\/\/www.shuizilong.com\/house\/?p=948"},"modified":"2014-08-27T08:18:24","modified_gmt":"2014-08-27T00:18:24","slug":"hdu-3948-the-number-of-palindromes","status":"publish","type":"post","link":"https:\/\/www.shuizilong.com\/house\/archives\/hdu-3948-the-number-of-palindromes\/","title":{"rendered":"HDU 3948. The Number of Palindromes"},"content":{"rendered":"<h3>Brief description: <\/h3>\n<p>\u3002\u3002\u3002<a href=\"https:\/\/www.shuizilong.com\/house\/archives\/spoj-705-new-distinct-substrings\/\"> SPOJ 705. New Distinct Substrings<\/a> \u548c <a href=\"https:\/\/www.shuizilong.com\/house\/archives\/ural-1297-palindrome\/\">URAL 1297. Palindrome<\/a> \u7684\u7ed3\u5408\u3002\u3002\u3002\u3002<br \/>\n\u6c42\u4e00\u4e2a\u5b57\u7b26\u4e32\u4e2d\uff0c\u56de\u6587\u5b50\u4e32\u7684\u4e2a\u6570\uff08\u5185\u5bb9\u76f8\u540c\uff0c\u4f4d\u7f6e\u4e0d\u540c\u7684\u7b97\u4e00\u4e2a\uff09\u3002<br \/>\n\u3002\u3002\u3002\u65f6\u9694\u8fd9\u4e48\u4e45\uff0c\u518d\u505a\u4e00\u904d\u4f9d\u7136\u89c9\u5f97\u8fd9\u662f\u4e00\u9053\u4e0d\u53ef\u591a\u5f97\u7684\u597d\u9898\u3002\u3002\u3002<\/p>\n<h3>Analysis: <\/h3>\n<p>\u3002\u3002\u3002\u8fd9\u4e2a\u9898\u6709\u4e24\u79cd\u98ce\u683c\u8fe5\u5f02\u7684\u505a\u6cd5\u3002\u540e\u7f00\u6570\u7ec4\u51f9\u548c Hash \u4e71\u641e\u3002\u3002\u3002<br \/>\n\u3002\u3002\u3002\u4e24\u79cd\u505a\u6cd5\u90fd\u6709\u53ef\u53d6\u4e4b\u5904\u3001\u53ef\u4ee5\u4e92\u76f8\u501f\u9274\u3002<br \/>\n\u3002\u3002\u3002\u5bf9\u4e8e\u56de\u6587\u5b50\u4e32\u95ee\u9898\u3002\u6211\u4eec\u77e5\u9053\u7ecf\u8fc7 <code>Interleave<\/code> \u4e4b\u540e\u3002<code>\uff08$.a.a.a.a. \uff09<\/code>\u3002<br \/>\n\u3002\u3002\u5c31\u4e0d\u9700\u8981\u8ba8\u8bba\u56de\u6587\u4e32\u957f\u5ea6\u7684\u5947\u5076\u4e86\u3002\u3002\uff08\u8fd9\u6837\u5f97\u5230\u7684\u7b54\u6848\u9700\u8981 \/ 2\u3002\u3002\u56e0\u4e3a\u6bcf\u79cd\u56de\u6587\u4e32\uff08\u5305\u62ec\u7a7a\u4e32\uff09\u90fd\u4f1a\u591a\u8ba1\u6570\u4e00\u6b21\u3002\u3002\uff09<br \/>\n\u3002\u3002\u4e0b\u9762\u7684\u505a\u6cd5\u90fd\u9ed8\u8ba4\u8fd9\u4e00\u70b9\u3002\u3002<\/p>\n<h4>\u7b97\u6cd5\u4e00\uff1a\u540e\u7f00\u6570\u7ec4<\/h4>\n<p>\u6211\u4eec\u9996\u5148\u56de\u5fc6 <a href=\"https:\/\/www.shuizilong.com\/house\/archives\/spoj-705-new-distinct-substrings\/\"> SPOJ 705. New Distinct Substrings<\/a>\u3002\u3002\u3002<\/p>\n<p>\u5728\u8fd9\u4e2a\u9898\u4e2d\u3002\u3002\u6211\u4eec\u4ece\u5de6\u5f80\u53f3\u626b\u63cf\u6bcf\u4e2a\u540e\u7f00\uff0c\u5e76\u7edf\u8ba1\u6240\u6709\u524d\u7f00\u5728 sa[i] \u7684\u8d21\u732e\u3002<br \/>\n\u3002\u8fd9\u4e2a\u6570\u503c\u662f\uff1a <code>n-sa[i]-h[i]<\/code>\u3002\u53ea\u6240\u4ee5\u8981\u51cf\u53bb <code>h[i]<\/code> \u662f\u56e0\u4e3a\u8fd9\u4e9b\u4e32\u4e4b\u524d\u5df2\u7ecf\u88ab\u7edf\u8ba1\u8fc7\uff0c\u907f\u514d\u91cd\u590d\u8ba1\u6570\u3002<\/p>\n<p>\u518d\u56de\u5fc6 <a href=\"https:\/\/www.shuizilong.com\/house\/archives\/ural-1297-palindrome\/\">URAL 1297. Palindrome<\/a> \u3002\u3002\u3002\uff08\u4ec5\u8ba8\u8bba\u5947\u6570\u957f\u5ea6\u7684\u56de\u6587\u5b50\u4e32\uff09\u3002\u3002\u3002<\/p>\n<p>\u5728\u90a3\u4e2a\u9898\u4e2d\u3002\u3002\u6211\u4eec\u68c0\u67e5\u6240\u6709\u6240\u6709 <code>lcpp(i, n-1-i) <\/code>\u3002\u3002\u4ece\u4e2d\u9009\u51fa\u7b54\u6848\u6700\u5927\u7684\u5373\u53ef\u3002\u3002\u3002<br \/>\n\u800c\u73b0\u5728\u6211\u4eec\u9700\u8981\u5b8c\u6210\u8ba1\u6570\u3002\u3002\u6211\u4eec\u7c7b\u6bd4\u524d\u9762\u4e00\u4e2a\u9898\u3002\u3002\u5c06\u6240\u6709 <code>lcpp(i, n-1-i)<\/code> \u53d6\u51fa\u3002\u3002<br \/>\n\u3002\u3002\u3002\u5f62\u6210\u4e00\u4e2a\u65b0\u7684 SA\u3002\u3002\u3002\u5728\u5f97\u5230 <code>h[]<\/code>\u3002\u3002\u6211\u4eec\u5c31\u53ef\u4ee5\u5982\u6cd5\u70ae\u5236\u3002\u3002<br \/>\n\u800c\u6211\u4eec\u53ef\u4ee5\u5f88\u65b9\u4fbf\u7684\u5f97\u5230\u65b0\u7684 SA\u3002\u3002\u3002\u3002<\/p>\n<pre class=\"brush: cpp; light: false; title: ; toolbar: true; notranslate\" title=\"\">\r\n...\r\nint hh&#x5B;N], oo&#x5B;N]; bool cp(int a,int b){\r\n    int t = lcpp(a, b);\r\n    if (t &lt;= hh&#x5B;a]) return t &lt;= hh&#x5B;b] ? r&#x5B;a]&lt;r&#x5B;b] : 0;\r\n    else return t &lt;= hh&#x5B;b] ? 1 : hh&#x5B;a]&lt;hh&#x5B;b];\r\n}\r\n...\r\nREP(i, nn) hh&#x5B;i] = lcpp(i, n-1-i), oo&#x5B;i] = i; sort(oo, oo+nn, cp);\r\n...\r\n<\/pre>\n<p>\u3002\u3002\u5f53 <code>t <= hh[a] &#038;&#038; t <= hh[b]<\/code> \u65f6\u3002\u3002\u6211\u4eec\u5c31\u53ef\u4ee5\u76f4\u63a5\u7528\u539f <code>SA<\/code> \u4e2d\u7684 <code>rank<\/code> \u6570\u7ec4\u5b8c\u6210\u6bd4\u8f83\uff08\u56e0\u4e3a\u8fd9\u4e24\u4e2a\u4e32\u5728<code>t+1<\/code>\u4f4d\u7f6e\u5df2\u7ecf\u5206\u51fa\u80dc\u8d1f\uff09\u3002\u5176\u4ed6\u60c5\u51b5\u7c7b\u4f3c\u3002\u3002\u3002<\/p>\n<p><a href=\"http:\/\/vjudge.net\/vjudge\/problem\/viewSource.action?id=2707432\">http:\/\/vjudge.net\/vjudge\/problem\/viewSource.action?id=2707432<\/a><\/p>\n<pre class=\"brush: cpp; light: false; title: ; toolbar: true; notranslate\" title=\"\">\r\n\/\/}\/* .................................................................................................................................. *\/\r\n\r\nconst int N = int(4e5) + 9, Z = 256;\r\n\r\nint a&#x5B;3*N], sa&#x5B;3*N], r&#x5B;N], h&#x5B;N];\r\nint C&#x5B;N], key&#x5B;N], t1&#x5B;N], t2&#x5B;N]; char s&#x5B;N], _s&#x5B;N];\r\nint n, _n;\r\n\r\ninline void rs(int *x, int *y, int *sa, int n, int m){\r\n    REP(i, n) key&#x5B;i] = i&#x5B;y]&#x5B;x];\r\n    memset(C, 0, sizeof(C&#x5B;0]) * m);\r\n    REP(i, n) ++C&#x5B;key&#x5B;i]];\r\n    FOR(i, 1, m) C&#x5B;i] += C&#x5B;i-1];\r\n    DWN(i, n, 0) sa&#x5B;--C&#x5B;key&#x5B;i]]] = y&#x5B;i];\r\n}\r\n\r\nvoid da(int a&#x5B;], int sa&#x5B;], int n, int m){\r\n    int *x = t1, *y = t2;\r\n    memset(C, 0, sizeof(C&#x5B;0]) * m);\r\n    REP(i, n) ++C&#x5B;x&#x5B;i] = a&#x5B;i]];\r\n    FOR(i, 1, m) C&#x5B;i] += C&#x5B;i-1];\r\n    DWN(i, n, 0) sa&#x5B;--C&#x5B;x&#x5B;i]]] = i;\r\n    for (int l = 1, p = 1; p &lt; n; l &lt;&lt;= 1, m = p){\r\n        p = 0; FOR(i, n-l, n) y&#x5B;p++] = i;\r\n        REP(i, n) if (sa&#x5B;i] &gt;= l) y&#x5B;p++] = sa&#x5B;i] - l;\r\n        rs(x, y, sa, n, m), swap(x, y), x&#x5B;sa&#x5B;0]] = 0, p = 0; FOR(i, 1, n)\r\n            x&#x5B;sa&#x5B;i]] = (y&#x5B;sa&#x5B;i]] == y&#x5B;sa&#x5B;i-1]] &amp;&amp; y&#x5B;sa&#x5B;i]+l] == y&#x5B;sa&#x5B;i-1]+l]) ? p : ++p;\r\n        ++p;\r\n    }\r\n}\r\n\r\n#define F(x) ((x)\/3+((x)%3==1?0:tb))\r\n#define G(x) ((x)&lt;tb?(x)*3+1:((x)-tb)*3+2)\r\nint c0(int *r,int a,int b)\r\n{return r&#x5B;a]==r&#x5B;b]&amp;&amp;r&#x5B;a+1]==r&#x5B;b+1]&amp;&amp;r&#x5B;a+2]==r&#x5B;b+2];}\r\nint c12(int k,int *r,int a,int b)\r\n{if(k==2) return r&#x5B;a]&lt;r&#x5B;b]||r&#x5B;a]==r&#x5B;b]&amp;&amp;c12(1,r,a+1,b+1);\r\n else return r&#x5B;a]&lt;r&#x5B;b]||r&#x5B;a]==r&#x5B;b]&amp;&amp;key&#x5B;a+1]&lt;key&#x5B;b+1];}\r\n\r\nvoid dc3(int a&#x5B;], int *sa, int n, int m){\r\n    int i, j, *an=a+n, *san=sa+n, ta=0, tb=(n+1)\/3, tbc=0, p;\r\n    a&#x5B;n] = a&#x5B;n+1] = 0; REP(i, n) if (i%3) t1&#x5B;tbc++]=i;\r\n\r\n    rs(a+2,t1,t2,tbc,m), rs(a+1,t2,t1,tbc,m), rs(a,t1,t2,tbc,m);\r\n    p = 0, an&#x5B;F(t2&#x5B;0])] = 0; FOR(i, 1, tbc)\r\n        an&#x5B;F(t2&#x5B;i])] = c0(a,t2&#x5B;i-1],t2&#x5B;i]) ? p : ++p;\r\n\r\n    if (++p &lt; tbc) dc3(an,san,tbc,p);\r\n    else REP(i, tbc) san&#x5B;an&#x5B;i]] = i;\r\n\r\n    REP(i, tbc) if(san&#x5B;i] &lt; tb) t2&#x5B;ta++] = san&#x5B;i] * 3;\r\n    if (n%3==1) t2&#x5B;ta++] = n-1; rs(a,t2,t1,ta,m);\r\n    REP(i, tbc) key&#x5B;t2&#x5B;i]=G(san&#x5B;i])] = i;\r\n\r\n    for(i=0,j=0,p=0; i&lt;ta &amp;&amp; j&lt;tbc; p++)\r\n        sa&#x5B;p]=c12(t2&#x5B;j]%3,a,t1&#x5B;i],t2&#x5B;j]) ? t1&#x5B;i++] : t2&#x5B;j++];\r\n    for(;i&lt;ta;p++) sa&#x5B;p]=t1&#x5B;i++]; for(;j&lt;tbc;p++) sa&#x5B;p]=t2&#x5B;j++];\r\n}\r\n\r\nvoid print_sa(){\r\n    REP_1(i, n){\r\n        cout &lt;&lt; sa&#x5B;i] &lt;&lt; &quot;: &quot;;\r\n        FOR(j, sa&#x5B;i], n) putchar(a&#x5B;j]);\r\n        puts(&quot;&quot;);\r\n    }\r\n}\r\n\r\nint get_h(){\r\n    REP_1(i, n) r&#x5B;sa&#x5B;i]] = i;\r\n    int k = 0; for (int i = 0; i &lt; n; h&#x5B;r&#x5B;i++]] = k){\r\n        if (k) --k; for (int j = sa&#x5B;r&#x5B;i]-1]; a&#x5B;i+k] == a&#x5B;j+k]; ++k);\r\n    }\r\n}\r\n\r\nconst int LV = 21; int ST&#x5B;LV]&#x5B;N];\r\n#define cmp(a,b)(h&#x5B;a]&lt;h&#x5B;b]?a:b)\r\nint lcp(int l, int r){\r\n    int lv = lg2(r-l); ++l,++r;\r\n    return min(h&#x5B;ST&#x5B;lv]&#x5B;l]], h&#x5B;ST&#x5B;lv]&#x5B;r-_1(lv)]]);\r\n}\r\n\r\n\r\nint lcpp(int l, int r){\r\n    \/\/if (l == r) return nn-l;\r\n    l = ::r&#x5B;l], r = ::r&#x5B;r]; if (l &gt; r) swap(l, r);\r\n    return lcp(l, r);\r\n}\r\nvoid get_lcp(){\r\n    REP_1(i, n) ST&#x5B;0]&#x5B;i] = i;\r\n    for (int lv=1;_1(lv)&lt;=n;++lv)\r\n        for (int i=1;i+_1(lv)&lt;=n+1;++i)\r\n            ST&#x5B;lv]&#x5B;i] = cmp(ST&#x5B;lv-1]&#x5B;i], ST&#x5B;lv-1]&#x5B;i+_1(lv-1)]);\r\n}\r\n#undef cmp\r\n\r\n\r\nint hh&#x5B;N], oo&#x5B;N]; bool cp(int a,int b){\r\n    int t = lcpp(a, b);\r\n    if (t &lt;= hh&#x5B;a]) return t &lt;= hh&#x5B;b] ? r&#x5B;a]&lt;r&#x5B;b] : 0;\r\n    else return t &lt;= hh&#x5B;b] ? 1 : hh&#x5B;a]&lt;hh&#x5B;b];\r\n}\r\n\r\nint main(){\r\n\r\n#ifndef ONLINE_JUDGE\r\n    freopen(&quot;in.txt&quot;, &quot;r&quot;, stdin);\r\n    \/\/freopen(&quot;out.txt&quot;, &quot;w&quot;, stdout);\r\n#endif\r\n\r\n    Rush{\r\n\r\n        RS(_s); int _n = strlen(_s);\r\n\r\n        REP(i, _n) s&#x5B;2*i] = '.', s&#x5B;2*i+1] = _s&#x5B;i]; int nn = 2*_n+1; s&#x5B;nn-1] = '.';\r\n        n = 0; REP(i, nn) a&#x5B;n++] = s&#x5B;i]; a&#x5B;n++] = '$';\r\n\r\n        DWN(i, nn, 0) a&#x5B;n++] = s&#x5B;i]; a&#x5B;n] = 0; dc3(a,sa,n+1,Z); get_h(); get_lcp();\r\n\t\t\/\/print_sa();\r\n\r\n\t\tREP(i, nn) hh&#x5B;i] = lcpp(i, n-1-i), oo&#x5B;i] = i; sort(oo, oo+nn, cp);\r\n\r\n        int z = 0, i1; REP(ii, nn){\r\n            int i = oo&#x5B;ii]; z += hh&#x5B;i];\r\n            if (ii) z -= min(hh&#x5B;i], hh&#x5B;i1], lcpp(i, i1));\r\n            i1 = i;\r\n        }\r\n        OT(z\/2);\r\n\t}\r\n}\r\n\r\n<\/pre>\n<h4>\u7b97\u6cd5\u4e8c\uff1aManacher + Hash<\/h4>\n<p>\u6ce8\u610f\u5230\u4e0d\u540c <code>Palindromes<\/code> \u7684\u603b\u6570\u662f <code>O(n)<\/code> \u7684\u3002\u3002\u6240\u4ee5\u53ef\u4ee5\u7528 Manacher + Hash \u66b4\u529b\u3002\u3002\u3002\u65b9\u6cd5\u662f\u679a\u4e3e\u6bcf\u4e2a\u56de\u6587\u4e2d\u5fc3\uff0c\u6309\u7167\u56de\u6587\u534a\u5f84\u4ece\u5927\u5230\u5c0f\u5229\u7528\u5b57\u7b26\u4e32 Hash \u679a\u4e3e\u56de\u6587\u4e32\uff0c\u5f53\u51fa\u73b0\u5df2\u7ecf\u51fa\u73b0\u8fc7\u7684\u56de\u6587\u4e32\u662f\u76f4\u63a5 break; \u6389\u3002\u3002\uff08\u66f4\u5c0f\u7684\u56de\u6587\u4e32\u4e00\u5b9a\u4e5f\u51fa\u73b0\u8fc7\u3002\u3002\uff09<\/p>\n<p>\uff08\u3002\u3002\u8fd9\u79cd\u65b9\u6cd5\u8fd8\u662f\u6bd4\u8f83\u5371\u9669\u3002\u3002\u3002\u6700\u597d\u7528\u4e00\u4e9b\u65b9\u6cd5\u51cf\u5c11\u51b2\u7a81\u7684\u673a\u4f1a\u3002\u3002\uff09<br \/>\n\uff08\u3002\u5947\u5076\u957f\u5ea6\u5206\u5f00\u8ba8\u8bba\uff0c\u4e0d\u653e\u8fdb\u76f8\u540c\u7684 Hash \u8868\u91cc\u3002\u3002\uff09<br \/>\n\uff08\u3002\u5f00 uLL\u3002\u3002\u3002\uff09<br \/>\n\uff08\u3002\u53cc hash\uff08\u591a\u53d6\u51e0\u4e2a\u6a21\u6216\u8005 + \u957f\u5ea6\u4fe1\u606f\uff09\u3002\u3002\u3002\uff09<\/p>\n<p>\u5b9e\u9645\u4e2d\u5e94\u8be5 3 \u7684\u6548\u679c\u6700\u7a33\u5b9a\u3002\u3002\u3002<\/p>\n<p><a href=\"http:\/\/vjudge.net\/vjudge\/problem\/viewSource.action?id=2706937\">http:\/\/vjudge.net\/vjudge\/problem\/viewSource.action?id=2706937<\/a><\/p>\n<h3>External link: <\/h3>\n<p><a href=\"http:\/\/hi.baidu.com\/lccycc_acm\/item\/70cf7e3f389ddd5881f1a7d3\">http:\/\/hi.baidu.com\/lccycc_acm\/item\/70cf7e3f389ddd5881f1a7d3<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Brief description: \u3002\u3002\u3002 SPOJ 705. New Distinct Substrings \u548c URAL 1297. Palindrome \u7684\u7ed3\u5408\u3002\u3002\u3002\u3002 \u6c42\u4e00\u4e2a\u5b57\u7b26\u4e32\u4e2d\uff0c\u56de\u6587\u5b50\u4e32\u7684\u4e2a\u6570\uff08\u5185\u5bb9\u76f8\u540c\uff0c\u4f4d\u7f6e\u4e0d\u540c\u7684\u7b97\u4e00\u4e2a\uff09\u3002 \u3002\u3002\u3002\u65f6\u9694\u8fd9\u4e48\u4e45\uff0c\u518d\u505a\u4e00\u904d\u4f9d\u7136\u89c9\u5f97\u8fd9\u662f\u4e00\u9053\u4e0d\u53ef\u591a\u5f97\u7684\u597d\u9898\u3002\u3002\u3002 Analysis: \u3002\u3002\u3002\u8fd9\u4e2a\u9898\u6709\u4e24\u79cd\u98ce\u683c\u8fe5\u5f02\u7684\u505a\u6cd5\u3002\u540e\u7f00\u6570\u7ec4\u51f9\u548c Hash \u4e71\u641e\u3002\u3002\u3002 \u3002\u3002\u3002\u4e24\u79cd\u505a\u6cd5\u90fd\u6709\u53ef\u53d6\u4e4b\u5904\u3001\u53ef\u4ee5\u4e92\u76f8\u501f\u9274\u3002 \u3002\u3002\u3002\u5bf9\u4e8e\u56de\u6587\u5b50\u4e32\u95ee\u9898\u3002\u6211\u4eec\u77e5\u9053\u7ecf\u8fc7 Interleave \u4e4b\u540e\u3002\uff08$.a.a.a.a. \uff09\u3002 \u3002\u3002\u5c31\u4e0d\u9700\u8981\u8ba8\u8bba\u56de\u6587\u4e32\u957f\u5ea6\u7684\u5947\u5076\u4e86\u3002\u3002\uff08\u8fd9\u6837\u5f97\u5230\u7684\u7b54\u6848\u9700\u8981 \/ 2\u3002\u3002\u56e0\u4e3a\u6bcf\u79cd\u56de\u6587\u4e32\uff08\u5305\u62ec\u7a7a\u4e32\uff09\u90fd\u4f1a\u591a\u8ba1\u6570\u4e00\u6b21\u3002\u3002\uff09 \u3002\u3002\u4e0b\u9762\u7684\u505a\u6cd5\u90fd\u9ed8\u8ba4\u8fd9\u4e00\u70b9\u3002\u3002 \u7b97\u6cd5\u4e00\uff1a\u540e\u7f00\u6570\u7ec4 \u6211\u4eec\u9996\u5148\u56de\u5fc6 SPOJ 705. New Distinct Substrings\u3002\u3002\u3002 \u5728\u8fd9\u4e2a\u9898\u4e2d\u3002\u3002\u6211\u4eec\u4ece\u5de6\u5f80\u53f3\u626b\u63cf\u6bcf\u4e2a\u540e\u7f00\uff0c\u5e76\u7edf\u8ba1\u6240\u6709\u524d\u7f00\u5728 sa[i] \u7684\u8d21\u732e\u3002 \u3002\u8fd9\u4e2a\u6570\u503c\u662f\uff1a n-sa[i]-h[i]\u3002\u53ea\u6240\u4ee5\u8981\u51cf\u53bb h[i] \u662f\u56e0\u4e3a\u8fd9\u4e9b\u4e32\u4e4b\u524d\u5df2\u7ecf\u88ab\u7edf\u8ba1\u8fc7\uff0c\u907f\u514d\u91cd\u590d\u8ba1\u6570\u3002 \u518d\u56de\u5fc6 URAL 1297. Palindrome \u3002\u3002\u3002\uff08\u4ec5\u8ba8\u8bba\u5947\u6570\u957f\u5ea6\u7684\u56de\u6587\u5b50\u4e32\uff09\u3002\u3002\u3002 \u5728\u90a3\u4e2a\u9898\u4e2d\u3002\u3002\u6211\u4eec\u68c0\u67e5\u6240\u6709\u6240\u6709 lcpp(i, n-1-i) \u3002\u3002\u4ece\u4e2d\u9009\u51fa\u7b54\u6848\u6700\u5927\u7684\u5373\u53ef\u3002\u3002\u3002 \u800c\u73b0\u5728\u6211\u4eec\u9700\u8981\u5b8c\u6210\u8ba1\u6570\u3002\u3002\u6211\u4eec\u7c7b\u6bd4\u524d\u9762\u4e00\u4e2a\u9898\u3002\u3002\u5c06\u6240\u6709 lcpp(i, n-1-i) \u53d6\u51fa\u3002\u3002 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[47,1],"tags":[],"class_list":["post-948","post","type-post","status-publish","format-standard","hentry","category-hdu","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2tdP7-fi","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/948","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/comments?post=948"}],"version-history":[{"count":1,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/948\/revisions"}],"predecessor-version":[{"id":949,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/posts\/948\/revisions\/949"}],"wp:attachment":[{"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/media?parent=948"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/categories?post=948"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shuizilong.com\/house\/wp-json\/wp\/v2\/tags?post=948"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}