{"id":132,"date":"2026-03-16T22:41:36","date_gmt":"2026-03-16T14:41:36","guid":{"rendered":"https:\/\/blog.heroking2000.com\/?p=132"},"modified":"2026-03-16T23:01:09","modified_gmt":"2026-03-16T15:01:09","slug":"%e7%9c%bc%e7%ba%a2%e7%9a%84medusa%ef%bc%88%e6%95%b0%e6%8d%ae%e5%a2%9e%e5%bc%ba%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.heroking2000.com\/?p=132","title":{"rendered":"\u773c\u7ea2\u7684Medusa\uff08\u6570\u636e\u589e\u5f3a\uff09"},"content":{"rendered":"\n<p>&nbsp;\u9898\u76ee\u63cf\u8ff0<\/p>\n\n\n\n<p>\u867d\u7136 Miss Medusa \u5230\u4e86\u5317\u4eac\uff0c\u9886\u4e86\u79d1\u6280\u521b\u65b0\u5956\uff0c\u4f46\u662f\u5979\u8fd8\u662f\u89c9\u5f97\u4e0d\u6ee1\u610f\u3002\u539f\u56e0\u662f\uff1a\u4ed6\u53d1\u73b0\u5f88\u591a\u4eba\u90fd\u548c\u5979\u4e00\u6837\u83b7\u4e86\u79d1\u6280\u521b\u65b0\u5956\uff0c\u7279\u522b\u662f\u5176\u4e2d\u7684\u67d0\u4e9b\u4eba\uff0c\u8fd8\u83b7\u5f97\u4e86\u53e6\u4e00\u4e2a\u5956\u9879\u2014\u2014\u7279\u6b8a\u8d21\u732e\u5956\u3002\u800c\u8d8a\u591a\u7684\u4eba\u83b7\u5f97\u4e86\u4e24\u4e2a\u5956\u9879\uff0cMiss Medusa\u5c31\u4f1a\u8d8a\u773c\u7ea2\u3002\u4e8e\u662f\u5979\u51b3\u5b9a\u7edf\u8ba1\u6709\u54ea\u4e9b\u4eba\u83b7\u5f97\u4e86\u4e24\u4e2a\u5956\u9879\uff0c\u6765\u77e5\u9053\u81ea\u5df1\u6709\u591a\u773c\u7ea2\u3002<\/p>\n\n\n\n<p>\u3010\u8f93\u5165\u683c\u5f0f\u3011<\/p>\n\n\n\n<p>\u7b2c\u4e00\u884c\u4e24\u4e2a\u6574\u6570&nbsp;<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>n<\/mi><mo separator=\"true\">,<\/mo><mi>m<\/mi><\/mrow><\/semantics><\/math>\uff0c\u8868\u793a\u6709&nbsp;<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>n<\/mi><\/mrow><\/semantics><\/math>&nbsp;\u4e2a\u4eba\u83b7\u5f97\u79d1\u6280\u521b\u65b0\u5956\uff0c<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>m<\/mi><\/mrow><\/semantics><\/math>&nbsp;\u4e2a\u4eba\u83b7\u5f97\u7279\u6b8a\u8d21\u732e\u5956\u3002<\/p>\n\n\n\n<p>\u7b2c\u4e8c\u884c&nbsp;<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>n<\/mi><\/mrow><\/semantics><\/math>&nbsp;\u4e2a\u6b63\u6574\u6570\uff0c\u8868\u793a\u83b7\u5f97\u79d1\u6280\u521b\u65b0\u5956\u7684\u4eba\u7684\u7f16\u53f7\u3002<\/p>\n\n\n\n<p>\u7b2c\u4e09\u884c&nbsp;<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>m<\/mi><\/mrow><\/semantics><\/math>&nbsp;\u4e2a\u6b63\u6574\u6570\uff0c\u8868\u793a\u83b7\u5f97\u7279\u6b8a\u8d21\u732e\u5956\u7684\u4eba\u7684\u7f16\u53f7\u3002<\/p>\n\n\n\n<p>\u3010\u8f93\u51fa\u683c\u5f0f\u3011<\/p>\n\n\n\n<p>\u8f93\u51fa\u4e00\u884c\uff0c\u4e3a\u83b7\u5f97\u4e24\u4e2a\u5956\u9879\u7684\u4eba\u7684\u7f16\u53f7\uff0c\u6309\u5728\u79d1\u6280\u521b\u65b0\u5956\u83b7\u5956\u540d\u5355\u4e2d\u7684\u5148\u540e\u6b21\u5e8f\u8f93\u51fa\u3002<\/p>\n\n\n\n<p>\u3010\u8f93\u5165\u8f93\u51fa\u6837\u4f8b#1\u3011<\/p>\n\n\n\n<p>\u8f93\u5165#1<\/p>\n\n\n\n<p>\u590d\u5236<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">4 3\n2 15 6 8\n8 9 2<\/pre>\n\n\n\n<p>\u8f93\u51fa#1<\/p>\n\n\n\n<p>\u590d\u5236<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">2 8<\/pre>\n\n\n\n<p>\u3010\u6570\u636e\u8303\u56f4\u3011<\/p>\n\n\n\n<p>\u5bf9\u4e8e&nbsp;<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>50<\/mn><mi mathvariant=\"normal\">%<\/mi><\/mrow><\/semantics><\/math>&nbsp;\u7684\u6570\u636e\uff0c<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>0<\/mn><mo>\u2264<\/mo><mi>n<\/mi><mo separator=\"true\">,<\/mo><mi>m<\/mi><mo>\u2264<\/mo><mn>1000<\/mn><\/mrow><\/semantics><\/math>\uff0c\u83b7\u5f97\u5956\u9879\u7684\u4eba\u7684\u7f16\u53f7&nbsp;<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mo>&lt;<\/mo><mn>2<\/mn><mo>\u00d7<\/mo><mn>1<\/mn><msup><mn>0<\/mn><mn>9<\/mn><\/msup><\/mrow><\/semantics><\/math>\uff1b<\/p>\n\n\n\n<p>\u5bf9\u4e8e&nbsp;<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>100<\/mn><mi mathvariant=\"normal\">%<\/mi><\/mrow><\/semantics><\/math>&nbsp;\u7684\u6570\u636e\uff0c<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>0<\/mn><mo>\u2264<\/mo><mi>n<\/mi><mo separator=\"true\">,<\/mo><mi>m<\/mi><mo>\u2264<\/mo><mn>1<\/mn><msup><mn>0<\/mn><mn>6<\/mn><\/msup><\/mrow><\/semantics><\/math>\uff0c\u83b7\u5f97\u5956\u9879\u7684\u4eba\u7684\u7f16\u53f7&nbsp;<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mo>&lt;<\/mo><mn>2<\/mn><mo>\u00d7<\/mo><mn>1<\/mn><msup><mn>0<\/mn><mn>18<\/mn><\/msup><\/mrow><\/semantics><\/math>\u3002<\/p>\n\n\n\n<p>\u8f93\u5165\u6570\u636e\u4fdd\u8bc1\u7b2c\u4e8c\u884c\u4efb\u610f\u4e24\u4e2a\u6570\u4e0d\u540c\uff0c\u7b2c\u4e09\u884c\u4efb\u610f\u4e24\u4e2a\u6570\u4e0d\u540c\u3002<\/p>\n\n\n\n<p>\u3010\u4ee3\u7801\u6837\u4f8b\u3011<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;bits\/stdc++.h>\nusing namespace std;\nint n,m;\nlong long a1&#91;1000005],a2&#91;1000005];\nint main(){\n\tcin>>n>>m;\n\tfor(int i=1;i&lt;=n;i++) cin>>a1&#91;i];\n\tfor(int i=1;i&lt;=m;i++) cin>>a2&#91;i];\n\tsort(a2+1,a2+m+1);\n\t\/\/sort(a1+1,a1+n+1);\n\tfor(int i=1;i&lt;=n;i++){\n\t\tif(a1&#91;i]==a2&#91;lower_bound(a2+1,a2+m+1,a1&#91;i])-a2]){\n\t\t\tcout&lt;&lt;a1&#91;i]&lt;&lt;\" \";\n\t\t}\n\t}\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;\u9898\u76ee\u63cf\u8ff0 \u867d\u7136 Miss Medusa \u5230\u4e86\u5317\u4eac\uff0c\u9886\u4e86\u79d1\u6280\u521b\u65b0\u5956\uff0c\u4f46\u662f\u5979\u8fd8\u662f\u89c9\u5f97\u4e0d\u6ee1\u610f\u3002\u539f\u56e0\u662f\uff1a\u4ed6 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[24,25],"class_list":["post-132","post","type-post","status-publish","format-standard","hentry","category-oi","tag-24","tag-25"],"_links":{"self":[{"href":"https:\/\/www.heroking2000.com\/index.php?rest_route=\/wp\/v2\/posts\/132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.heroking2000.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.heroking2000.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.heroking2000.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.heroking2000.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=132"}],"version-history":[{"count":2,"href":"https:\/\/www.heroking2000.com\/index.php?rest_route=\/wp\/v2\/posts\/132\/revisions"}],"predecessor-version":[{"id":134,"href":"https:\/\/www.heroking2000.com\/index.php?rest_route=\/wp\/v2\/posts\/132\/revisions\/134"}],"wp:attachment":[{"href":"https:\/\/www.heroking2000.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.heroking2000.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.heroking2000.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}