{"id":166,"date":"2026-03-23T23:17:52","date_gmt":"2026-03-23T15:17:52","guid":{"rendered":"https:\/\/www.heroking2000.com\/?p=166"},"modified":"2026-03-23T23:17:52","modified_gmt":"2026-03-23T15:17:52","slug":"%e6%b7%b1%e6%b5%b7%e7%8e%af%e5%8d%ab","status":"publish","type":"post","link":"https:\/\/www.heroking2000.com\/?p=166","title":{"rendered":"\u6df1\u6d77\u73af\u536b"},"content":{"rendered":"\n<p>\u9898\u76ee\u63cf\u8ff0<\/p>\n\n\n\n<p>\u76ae\u76ae\u6700\u8fd1\u5bf9\u4e8e\u73af\u4fdd\u975e\u5e38\u5173\u6ce8\uff0c\u4ed6\u4e86\u89e3\u5230\u6df1\u6d77\u91cc\u6709\u5f88\u591a\u5f88\u591a\u5783\u573e\uff0c\u56e0\u6b64\u51c6\u5907\u53bb\u6df1\u6d77\u5f00\u5c55\u4e00\u9879\u5783\u573e\u6e05\u9664\u6d3b\u52a8\u3002<\/p>\n\n\n\n<p>\u7ecf\u8fc7\u63a2\u6d4b\uff0c\u6df1\u6d77\u4e2d\u4e00\u5171\u6709 n \u4e2a\u533a\u57df\uff0c\u73af\u536b\u961f\u4f1a\u5bf9\u6240\u6709\u533a\u57df\u90fd\u540c\u65f6\u5f00\u5c55\u6e05\u7406\uff0c\u6e05\u7406\u901f\u5ea6\u4e3a\u6bcf\u79d2 a \u5343\u514b\uff0c \u6bcf\u4e00\u4e2a\u533a\u57df\u7684\u5783\u573e\u5728\u6e05\u7406\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><msub><mi>t<\/mi><mi>i<\/mi><\/msub><\/mrow><\/semantics><\/math>\u79d2\u540e\u5c31\u4f1a\u88ab\u6e05\u7406\u5e72\u51c0\u3002<\/p>\n\n\n\n<p>\u4e3a\u4e86\u8fbe\u6210\u6e05\u7406\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>M<\/mi><\/mrow><\/semantics><\/math>\u00a0\u5343\u514b\u5783\u573e\u7684\u76ee\u6807\uff0c\u8bf7\u95ee\u73af\u4fdd\u4eba\u5458\u6700\u5c11\u9700\u8981\u5728\u6d77\u91cc\u6e05\u7406\u591a\u4e45\uff1f<\/p>\n\n\n\n<p>\u3010\u8f93\u5165\u683c\u5f0f\u3011<\/p>\n\n\n\n<p>\u8f93\u5165\u5171 2 \u884c\uff1a<br>\u7b2c 1 \u884c\uff1a3 \u4e2a\u7a7a\u683c\u9694\u5f00\u7684\u6b63\u6574\u6570\uff0c\u5206\u522b\u4e3a n, M, a, \u5206\u522b\u4ee3\u8868\u533a\u57df\u6570\u91cf\uff0c\u6e05\u7406\u5783\u573e\u7684\u76ee\u6807\u91cd\u91cf\uff0c\u6bcf\u79d2\u6e05\u7406\u5783\u573e\u7684\u91cd\u91cf\u3002<br>\u7b2c 2 \u884c\uff1an \u4e2a\u7a7a\u683c\u9694\u5f00\u7684\u6b63\u6574\u6570\uff0c\u5206\u522b\u8868\u793a\u6bcf\u4e2a\u533a\u57df\u9700\u8981\u6e05\u7406\u7684\u65f6\u95f4\u3002<\/p>\n\n\n\n<p>\u3010\u8f93\u51fa\u683c\u5f0f\u3011<\/p>\n\n\n\n<p>\u8f93\u51fa\u5171 1 \u884c<br>\u7b2c 1 \u884c\uff1a1 \u4e2a\u6574\u6570\uff0c\u8868\u793a\u6700\u5c11\u9700\u8981\u6e05\u7406\u7684\u65f6\u95f4<\/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<pre class=\"wp-block-preformatted\">5 100 5\n20 5 2 4 8<\/pre>\n\n\n\n<p>\u8f93\u51fa#1<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">5<\/pre>\n\n\n\n<p>\u3010\u6570\u636e\u8303\u56f4\u3011<\/p>\n\n\n\n<p><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>1<\/mn><mo>\u2264<\/mo><mi>n<\/mi><mo>\u2264<\/mo><mn>1<\/mn><msup><mn>0<\/mn><mn>6<\/mn><\/msup><mo separator=\"true\">,<\/mo><mn>1<\/mn><mo>\u2264<\/mo><msub><mi>t<\/mi><mi>i<\/mi><\/msub><mo>\u2264<\/mo><mn>1<\/mn><msup><mn>0<\/mn><mn>7<\/mn><\/msup><mo separator=\"true\">,<\/mo><mn>1<\/mn><mo>\u2264<\/mo><mi>a<\/mi><mo>\u2264<\/mo><mn>100.<\/mn><\/mrow><\/semantics><\/math>\u8f93\u5165\u4fdd\u8bc1\u4e00\u5b9a\u80fd\u6e05\u7406 M \u5343\u514b\u7684\u5783\u573e<\/p>\n\n\n\n<p>\u3010\u4ee3\u7801\u793a\u4f8b\u3011<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;bits\/stdc++.h>\nusing namespace std;\nint n, m, a, c&#91;1000005];\n\nbool chk(int x) {\n\tint sum = 0;\n\tfor (int i = 1; i &lt;= n; i++) {\n\t\tif (c&#91;i] >= x) {\n\t\t\tsum += x * a;\n\t\t} else {\n\t\t\tsum += c&#91;i] * a;\n\t\t}\n\t}\n\treturn sum >= m;\n}\n\nint main() {\n\tcin >> n >> m >> a;\n\tfor (int i = 1; i &lt;= n; i++)\n\t\tcin >> c&#91;i];\n\tint l = 1, r = 1e7, ans = -1;\n\n\twhile (l &lt;= r) {\n\t\tint mid = l + (r - l) \/ 2;\n\t\tif (chk(mid)) {\n\t\t\tr = mid - 1;\n\t\t\tans = mid;\n\t\t} else\n\t\t\tl = mid + 1;\n\t}\n\tcout &lt;&lt; ans &lt;&lt; endl;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u9898\u76ee\u63cf\u8ff0 \u76ae\u76ae\u6700\u8fd1\u5bf9\u4e8e\u73af\u4fdd\u975e\u5e38\u5173\u6ce8\uff0c\u4ed6\u4e86\u89e3\u5230\u6df1\u6d77\u91cc\u6709\u5f88\u591a\u5f88\u591a\u5783\u573e\uff0c\u56e0\u6b64\u51c6\u5907\u53bb\u6df1\u6d77\u5f00\u5c55\u4e00\u9879\u5783\u573e\u6e05\u9664\u6d3b\u52a8\u3002 \u7ecf\u8fc7\u63a2 [&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-166","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\/166","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=166"}],"version-history":[{"count":1,"href":"https:\/\/www.heroking2000.com\/index.php?rest_route=\/wp\/v2\/posts\/166\/revisions"}],"predecessor-version":[{"id":167,"href":"https:\/\/www.heroking2000.com\/index.php?rest_route=\/wp\/v2\/posts\/166\/revisions\/167"}],"wp:attachment":[{"href":"https:\/\/www.heroking2000.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=166"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.heroking2000.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=166"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.heroking2000.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=166"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}