{"id":1400,"date":"2023-05-13T20:54:25","date_gmt":"2023-05-13T12:54:25","guid":{"rendered":"https:\/\/sanlangcode.com\/?p=1400"},"modified":"2023-05-13T20:54:25","modified_gmt":"2023-05-13T12:54:25","slug":"hj32-%e5%af%86%e7%a0%81%e6%88%aa%e5%8f%96","status":"publish","type":"post","link":"https:\/\/sanlangcode.com\/index.php\/2023\/05\/13\/hj32-%e5%af%86%e7%a0%81%e6%88%aa%e5%8f%96\/","title":{"rendered":"HJ32 \u5bc6\u7801\u622a\u53d6"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u63cf\u8ff0<\/h2>\n\n\n\n<p>Catcher\u662fMCA\u56fd\u7684\u60c5\u62a5\u5458\uff0c\u4ed6\u5de5\u4f5c\u65f6\u53d1\u73b0\u654c\u56fd\u4f1a\u7528\u4e00\u4e9b\u5bf9\u79f0\u7684\u5bc6\u7801\u8fdb\u884c\u901a\u4fe1\uff0c\u6bd4\u5982\u50cf\u8fd9\u4e9bABBA\uff0cABA\uff0cA\uff0c123321\uff0c\u4f46\u662f\u4ed6\u4eec\u6709\u65f6\u4f1a\u5728\u5f00\u59cb\u6216\u7ed3\u675f\u65f6\u52a0\u5165\u4e00\u4e9b\u65e0\u5173\u7684\u5b57\u7b26\u4ee5\u9632\u6b62\u522b\u56fd\u7834\u89e3\u3002\u6bd4\u5982\u8fdb\u884c\u4e0b\u5217\u53d8\u5316&nbsp;ABBA-&gt;12ABBA,ABA-&gt;ABAKK,123321-&gt;51233214\u3000\u3002\u56e0\u4e3a\u622a\u83b7\u7684\u4e32\u592a\u957f\u4e86\uff0c\u800c\u4e14\u5b58\u5728\u591a\u79cd\u53ef\u80fd\u7684\u60c5\u51b5\uff08abaaab\u53ef\u770b\u4f5c\u662faba,\u6216baaab\u7684\u52a0\u5bc6\u5f62\u5f0f\uff09\uff0cCathcer\u7684\u5de5\u4f5c\u91cf\u5b9e\u5728\u662f\u592a\u5927\u4e86\uff0c\u4ed6\u53ea\u80fd\u5411\u7535\u8111\u9ad8\u624b\u6c42\u52a9\uff0c\u4f60\u80fd\u5e2eCatcher\u627e\u51fa\u6700\u957f\u7684\u6709\u6548\u5bc6\u7801\u4e32\u5417\uff1f<br>\u6570\u636e\u8303\u56f4\uff1a\u5b57\u7b26\u4e32\u957f\u5ea6\u6ee1\u8db3&nbsp;1\u2264\ufffd\u22642500&nbsp;1\u2264<em>n<\/em>\u22642500&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u8f93\u5165\u63cf\u8ff0\uff1a<\/h3>\n\n\n\n<p>\u8f93\u5165\u4e00\u4e2a\u5b57\u7b26\u4e32\uff08\u5b57\u7b26\u4e32\u7684\u957f\u5ea6\u4e0d\u8d85\u8fc72500\uff09<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u8f93\u51fa\u63cf\u8ff0\uff1a<\/h3>\n\n\n\n<p>\u8fd4\u56de\u6709\u6548\u5bc6\u7801\u4e32\u7684\u6700\u5927\u957f\u5ea6<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u793a\u4f8b1<\/h2>\n\n\n\n<p>\u8f93\u5165\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ABBA<\/pre>\n\n\n\n<p>\u8f93\u51fa\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">4<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u793a\u4f8b2<\/h2>\n\n\n\n<p>\u8f93\u5165\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ABBBA<\/pre>\n\n\n\n<p>\u590d\u5236\u8f93\u51fa\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">5<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u793a\u4f8b3<\/h2>\n\n\n\n<p>\u8f93\u5165\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">12HHHHA<\/pre>\n\n\n\n<p>\u590d\u5236\u8f93\u51fa\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">4<\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>import java.util.*;\n\/\/\u672c\u8d28\u662f\u6c42\u4efb\u610f\u5b57\u7b26\u4e32\u7684\u6700\u957f\u5bf9\u79f0\u5b50\u4e32 \u8f93\u51fa\u68cb\u957f\u5ea6\n\/\/\u91c7\u53d6\u4e2d\u5fc3\u6269\u6563\u6cd5\npublic class Main {\n    public static void main(String&#91;] args) {\n        Scanner in = new Scanner(System.in);\n        String str = in.nextLine();\n        System.out.print(longestdemo(str));\n    }\n    public static int longestdemo(String str){\n        int n=str.length();\n        int start = 0;\n        int maxLength = 0;\n        for(int i=0 ; i &lt;2*n-1;i++){\n            int left = i\/2;\n            int right = left+i%2;\n            while(left>=0 &amp;&amp; right&lt;n &amp;&amp; str.charAt(left)==str.charAt(right)){\n                left--;\n                right++;\n            }\n            int len = right-left-1;\n            if(len>maxLength){\n                maxLength=len; \n                start=left+1;}\n        }\n        return str.substring(start,start+maxLength).length();\n    }\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u63cf\u8ff0 Catcher\u662fMCA\u56fd\u7684&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1400","post","type-post","status-publish","format-standard","hentry","category-4"],"_links":{"self":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/posts\/1400","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/comments?post=1400"}],"version-history":[{"count":0,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/posts\/1400\/revisions"}],"wp:attachment":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/media?parent=1400"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/categories?post=1400"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/tags?post=1400"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}