{"id":1244,"date":"2022-06-01T09:25:10","date_gmt":"2022-06-01T01:25:10","guid":{"rendered":"https:\/\/sanlangcode.com\/?p=1244"},"modified":"2022-06-01T09:25:10","modified_gmt":"2022-06-01T01:25:10","slug":"hj84-%e7%bb%9f%e8%ae%a1%e5%a4%a7%e5%86%99%e5%ad%97%e6%af%8d%e4%b8%aa%e6%95%b0-a-z%e4%b8%8ea-z","status":"publish","type":"post","link":"https:\/\/sanlangcode.com\/index.php\/2022\/06\/01\/hj84-%e7%bb%9f%e8%ae%a1%e5%a4%a7%e5%86%99%e5%ad%97%e6%af%8d%e4%b8%aa%e6%95%b0-a-z%e4%b8%8ea-z\/","title":{"rendered":"HJ84 \u7edf\u8ba1\u5927\u5199\u5b57\u6bcd\u4e2a\u6570 ^[A-Z]\u4e0e[^A-Z]"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u63cf\u8ff0<\/h2>\n\n\n\n<p>\u627e\u51fa\u7ed9\u5b9a\u5b57\u7b26\u4e32\u4e2d\u5927\u5199\u5b57\u7b26(\u5373&#8217;A&#8217;-&#8216;Z&#8217;)\u7684\u4e2a\u6570\u3002\u6570\u636e\u8303\u56f4\uff1a\u5b57\u7b26\u4e32\u957f\u5ea6\uff1a1\\le |s|\\le 250\\1\u2264\u2223<em>s<\/em>\u2223\u2264250&nbsp;\u5b57\u7b26\u4e32\u4e2d\u53ef\u80fd\u5305\u542b\u7a7a\u683c\u6216\u5176\u4ed6\u5b57\u7b26\u8fdb\u9636\uff1a\u65f6\u95f4\u590d\u6742\u5ea6\uff1aO(n)\\<em>O<\/em>(<em>n<\/em>)&nbsp;\uff0c\u7a7a\u95f4\u590d\u6742\u5ea6\uff1aO(n)\\<em>O<\/em>(<em>n<\/em>)&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u8f93\u5165\u63cf\u8ff0\uff1a<\/h3>\n\n\n\n<p>\u5bf9\u4e8e\u6bcf\u7ec4\u6837\u4f8b\uff0c\u8f93\u5165\u4e00\u884c\uff0c\u4ee3\u8868\u5f85\u7edf\u8ba1\u7684\u5b57\u7b26\u4e32<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u8f93\u51fa\u63cf\u8ff0\uff1a<\/h3>\n\n\n\n<p>\u8f93\u51fa\u4e00\u4e2a\u6574\u6570\uff0c\u4ee3\u8868\u5b57\u7b26\u4e32\u4e2d\u5927\u5199\u5b57\u6bcd\u7684\u4e2a\u6570<\/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\">A 1 0 1 1150175017(&amp;^%&amp;$vabovbaoadd 123#$%#%#O\n<\/pre>\n\n\n\n<p>\u8f93\u51fa\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">2\n<\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>import java.util.*;\n\n\/\/^&#91;a-z] \u5339\u914d\u4ee5\u5c0f\u5199\u5b57\u6bcd \u5f00\u5934 \u7684\u6587\u672c\u4e32 \n\/\/&#91;^a-z] \u8868\u793a\u4e0e \u4e0d\u5305\u542b \u5c0f\u5199\u5b57\u6bcd\u7684\u5b57\u7b26\u5339\u914d \npublic class Main {\n    public static void main(String&#91;] args) {\n        Scanner in = new Scanner(System.in);\n        while (in.hasNext()) { \n            System.out.println(in.nextLine().replaceAll(\"&#91;^A-Z]\",\"\").length());\n        }\n    }\n}\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">^[a-z] \u5339\u914d\u4ee5\u5c0f\u5199\u5b57\u6bcd \u5f00\u5934 \u7684\u6587\u672c\u4e32 <br>[^a-z] \u8868\u793a\u4e0e \u4e0d\u5305\u542b \u5c0f\u5199\u5b57\u6bcd\u7684\u5b57\u7b26\u5339\u914d <\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u63cf\u8ff0 \u627e\u51fa\u7ed9\u5b9a\u5b57\u7b26\u4e32\u4e2d\u5927\u5199\u5b57\u7b26(&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":1122,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1244","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-4"],"_links":{"self":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/posts\/1244","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=1244"}],"version-history":[{"count":0,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/posts\/1244\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/media\/1122"}],"wp:attachment":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/media?parent=1244"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/categories?post=1244"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/tags?post=1244"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}