{"id":80,"date":"2025-10-18T22:45:32","date_gmt":"2025-10-18T14:45:32","guid":{"rendered":"https:\/\/www.yiersan79.com\/?p=80"},"modified":"2025-10-18T22:45:32","modified_gmt":"2025-10-18T14:45:32","slug":"%e6%9c%80%e9%95%bf%e5%85%83%e9%9f%b3%e5%9b%9e%e6%96%87%e5%ad%90%e4%b8%b2","status":"publish","type":"post","link":"https:\/\/www.yiersan79.com\/index.php\/2025\/10\/18\/%e6%9c%80%e9%95%bf%e5%85%83%e9%9f%b3%e5%9b%9e%e6%96%87%e5%ad%90%e4%b8%b2\/","title":{"rendered":"\u6700\u957f\u5143\u97f3\u56de\u6587\u5b50\u4e32"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>\u63cf\u8ff0<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5c0f\u725b\u6709\u4e00\u4e2a\u957f\u5ea6\u4e3an\u7684\u5b57\u7b26\u4e32s\uff0c\u5b57\u7b26\u4e32\u4ec5\u5305\u542b\u5c0f\u5199\u82f1\u6587\u5b57\u7b26\u3002 \u5b9a\u4e49\u5143\u97f3\u5b57\u6bcd\u4e3a\uff5ba\uff0ce\uff0ci\uff0co\uff0cu\uff5d\uff0c\u5176\u4ed6\u5b57\u6bcd\u4e3a\u8f85\u97f3\u5b57\u6bcd\u3002 \u8bf7\u4f60\u5728s\u4e2d\u627e\u5230\u4e00\u4e2a\u6700\u957f\u7684\u5143\u97f3\u56de\u6587\u5b50\u4e32\uff0c\u53ea\u9700\u8981\u8f93\u51fa\u5176\u957f\u5ea6\u3002 \u5b50\u4e32\u662f\u6307\u4ece\u539f\u5b57\u7b26\u4e32\u4e2d\uff0c\u9009\u62e9\u4e00\u6bb5\u8fde\u7eed\u7684\u5b57\u7b26\u7ec4\u6210\u7684\u65b0\u5b57\u7b26\u4e32\u3002 \u4e00\u4e2a\u957f\u5ea6\u4e3am\u7684\u5143\u97f3\u56de\u6587\u4e32t\u662f\u6307\uff0c\u5bf9\u4e8e\u4efb\u610fi\u2208\uff3b1\uff0cm\uff3d\uff0c\u5982\u679ct\u662f\u5143\u97f3\uff0c\u5219\u9700\u6ee1\u8db3 \u200b\uff1b\u5982\u679c<em>ti<\/em>\u200b\u662f\u8f85\u97f3\uff0c\u90a3\u4e48\u6ca1\u6709\u989d\u5916\u9650\u5236\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u8f93\u5165<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7b2c\u4e00\u884c\u8f93\u5165\u4e00\u4e2a\u6574\u6570n\uff081\u2264n\u226410^5\uff09\uff0c\u4ee3\u8868\u5b57\u7b26\u4e32\u7684\u957f\u5ea6\u3002 \u7b2c\u4e8c\u884c\u8f93\u5165\u4e00\u4e2a\u957f\u5ea6\u4e3an\u4e14\u4ec5\u7531\u5c0f\u5199\u82f1\u6587\u5b57\u6bcd\u7ec4\u6210\u7684\u5b57\u7b26\u4e32s\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u8f93\u51fa<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u4e00\u884c\u4e0a\u8f93\u51fa\u4e00\u4e2a\u6574\u6570\uff0c\u4ee3\u8868\u6700\u957f\u7684\u5143\u97f3\u56de\u6587\u4e32\u7684\u957f\u5ea6\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">\u8f93\u51651<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>5\nabaeb<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8f93\u51fa1<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>3<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8f93\u51652<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>6\ncccccc<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8f93\u51fa2<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>6<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>python\u4ee3\u7801<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def is_vowel(c):\n    return c in \"aeiou\"\n\n\ndef expand_from_center(s, left, right):\n    while left >= 0 and right &lt; len(s):\n        if (is_vowel(s&#91;left]) or is_vowel(s&#91;right])) and s&#91;left] != s&#91;right]:\n            break\n        left -= 1<span class=\"crayon-inline lang:python decode:true\">def is_vowel(c):\n    return c in \"aeiou\"\n\n\ndef expand_from_center(s, left, right):\n    while left >= 0 and right &lt; len(s):\n        if (is_vowel(s&#91;left]) or is_vowel(s&#91;right])) and s&#91;left] != s&#91;right]:\n            break\n        left -= 1\n        right += 1\n    # (right - 1) - (left + 1) + 1\n    return right - left - 1\n\n\nif __name__ == '__main__':\n    n = int(input())\n    s = input()\n    max_length = 0\n    for i in range(n):\n        odd_length = expand_from_center(s, i, i)\n        max_length = max(max_length, odd_length)\n        if i &lt; n - 1:\n            even_length = expand_from_center(s, i, i + 1)\n            max_length = max(max_length, even_length)\n    print(max_length)\n<\/span>\n        right += 1\n    # (right - 1) - (left + 1) + 1\n    return right - left - 1\n\n\nif __name__ == '__main__':\n    n = int(input())\n    s = input()\n    max_length = 0\n    for i in range(n):\n        odd_length = expand_from_center(s, i, i)\n        max_length = max(max_length, odd_length)\n        if i &lt; n - 1:\n            even_length = expand_from_center(s, i, i + 1)\n            max_length = max(max_length, even_length)\n    print(max_length)\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u63cf\u8ff0 \u5c0f\u725b\u6709\u4e00\u4e2a\u957f\u5ea6\u4e3an\u7684\u5b57\u7b26\u4e32s\uff0c\u5b57\u7b26\u4e32\u4ec5\u5305\u542b\u5c0f\u5199\u82f1\u6587\u2026<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-80","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.yiersan79.com\/index.php\/wp-json\/wp\/v2\/posts\/80","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yiersan79.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yiersan79.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yiersan79.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yiersan79.com\/index.php\/wp-json\/wp\/v2\/comments?post=80"}],"version-history":[{"count":1,"href":"https:\/\/www.yiersan79.com\/index.php\/wp-json\/wp\/v2\/posts\/80\/revisions"}],"predecessor-version":[{"id":81,"href":"https:\/\/www.yiersan79.com\/index.php\/wp-json\/wp\/v2\/posts\/80\/revisions\/81"}],"wp:attachment":[{"href":"https:\/\/www.yiersan79.com\/index.php\/wp-json\/wp\/v2\/media?parent=80"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yiersan79.com\/index.php\/wp-json\/wp\/v2\/categories?post=80"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yiersan79.com\/index.php\/wp-json\/wp\/v2\/tags?post=80"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}