{"id":112844,"date":"2026-10-05T01:25:24","date_gmt":"2026-10-04T17:25:24","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/112844.html"},"modified":"2026-10-05T01:25:24","modified_gmt":"2026-10-04T17:25:24","slug":"gesp2026%e5%b9%b49%e6%9c%88%e8%ae%a4%e8%af%81c%e4%b8%83%e7%ba%a7-%e7%ac%ac%e4%ba%8c%e9%83%a8%e5%88%86%e5%88%a4%e6%96%ad%e9%a2%98%ef%bc%88110%e9%a2%98%ef%bc%89%e7%b2%be%e8%ae%b2","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/112844.html","title":{"rendered":"GESP2026\u5e749\u6708\u8ba4\u8bc1C++\u4e03\u7ea7( \u7b2c\u4e8c\u90e8\u5206\u5224\u65ad\u9898\uff081~10\u9898\uff09\u7cbe\u8bb2"},"content":{"rendered":"<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004172520-6ac28c00611cb.png\" \/><\/p>\n<hr \/>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004172521-6ac28c0120ea1.png\" \/><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004172521-6ac28c018acc7.png\" \/><\/p>\n<hr \/>\n<h2>\u7b2c1\u9898&#xff1a;exp(0) \u7684\u7ed3\u679c<\/h2>\n<p>\u6b63\u786e<\/p>\n<p>\u9898\u76ee&#xff1a;<\/p>\n<p>\u4f7f\u7528 cmath \u6216 math.h \u4e2d\u7684\u51fd\u6570&#xff0c;\u8868\u8fbe\u5f0f exp(0) \u7684\u7ed3\u679c\u503c\u4e3a 1.0&#xff0c;\u4e14\u7c7b\u578b\u4e3a double\u3002<\/p>\n<h4>\u7b2c\u4e00\u6b65&#xff1a;\u8ba4\u8bc6 exp \u51fd\u6570<\/h4>\n<p>exp(x) \u662fC&#043;&#043;\u6570\u5b66\u5e93\u4e2d\u7684\u4e00\u4e2a\u51fd\u6570&#xff0c;\u5b83\u8868\u793a&#xff1a;<\/p>\n<p>exp(x)\u00a0 &#061; e^x<\/p>\n<p>\u8fd9\u91cc\u7684 e \u662f\u4e00\u4e2a\u6570\u5b66\u5e38\u6570&#xff0c;\u7ea6\u7b49\u4e8e&#xff1a;<\/p>\n<p>e \u2248 2.71828<\/p>\n<p>\u56e0\u6b64&#xff1a;<\/p>\n<p>exp(0) &#061; e^0 &#061;1<\/p>\n<p>\u6240\u4ee5&#xff0c;\u7ed3\u679c\u786e\u5b9e\u662f1.0\u3002<\/p>\n<hr \/>\n<h4>\u7b2c\u4e8c\u6b65&#xff1a;\u4e3a\u4ec0\u4e48\u7ed3\u679c\u7c7b\u578b\u662f double&#xff1f;<\/h4>\n<p>\u5728C&#043;&#043;\u4e2d&#xff0c;exp() \u51fd\u6570\u8fd4\u56de\u7684\u662f double \u7c7b\u578b\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>C&#043;&#043;<\/p>\n<p>#include &lt;iostream&gt;<br \/>\n#include &lt;cmath&gt;<br \/>\nusing namespace std;<\/p>\n<p>int main() {<br \/>\n    double a &#061; exp(0);<br \/>\n    cout &lt;&lt; a &lt;&lt; endl;<\/p>\n<p>    return 0;<br \/>\n}<\/p>\n<p>\u8f93\u51fa&#xff1a;<\/p>\n<p>1<\/p>\n<p>\u6ce8\u610f&#xff1a;\u867d\u7136\u5c4f\u5e55\u4e0a\u663e\u793a\u7684\u662f 1&#xff0c;\u4f46\u5b83\u7684\u5b9e\u9645\u8fd4\u56de\u7c7b\u578b\u4ecd\u7136\u662f double\u3002<\/p>\n<p>\u8fd9\u662f\u56e0\u4e3a\u8f93\u51fa\u65f6&#xff0c;\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u4e0d\u4f1a\u7279\u610f\u663e\u793a\u5c0f\u6570\u70b9\u540e\u9762\u7684\u96f6\u3002<\/p>\n<hr \/>\n<p>\u5982\u679c\u60f3\u8ba9\u5b83\u663e\u793a\u4e3a 1.000000&#xff0c;\u53ef\u4ee5\u4f7f\u7528&#xff1a;<\/p>\n<p>C&#043;&#043;<\/p>\n<p>#include &lt;iostream&gt;<br \/>\n#include &lt;cmath&gt;<br \/>\n#include &lt;iomanip&gt;<br \/>\nusing namespace std;<\/p>\n<p>int main() {<br \/>\n    cout &lt;&lt; fixed &lt;&lt; setprecision(6);<br \/>\n    cout &lt;&lt; exp(0) &lt;&lt; endl;<\/p>\n<p>    return 0;<br \/>\n}<\/p>\n<p>\u8f93\u51fa&#xff1a;<\/p>\n<p>1.000000<\/p>\n<hr \/>\n<h4>\u7b2c\u4e09\u6b65&#xff1a;\u4e3e\u4e00\u53cd\u4e09<\/h4>\n<p>\u8bb0\u4f4f\u4e0b\u9762\u8fd9\u4e9b\u5e38\u89c1\u6570\u5b66\u51fd\u6570&#xff1a;<\/p>\n<table>\n<tr>\u51fd\u6570\u542b\u4e49\u4f8b\u5b50<\/tr>\n<tbody>\n<tr>\n<td>exp(x)<\/td>\n<td>e^x<\/td>\n<td>exp(0)&#061;1<\/td>\n<\/tr>\n<tr>\n<td>sqrt(x)<\/td>\n<td>\u5e73\u65b9\u6839<\/td>\n<td>sqrt(9)&#061;3<\/td>\n<\/tr>\n<tr>\n<td>pow(a,b)<\/td>\n<td>a^b<\/td>\n<td>pow(2,3)&#061;8<\/td>\n<\/tr>\n<tr>\n<td>fabs(x)<\/td>\n<td>\u6d6e\u70b9\u6570\u7edd\u5bf9\u503c<\/td>\n<td>fabs(-3.5)&#061;3.5<\/td>\n<\/tr>\n<tr>\n<td>log(x)<\/td>\n<td>\u81ea\u7136\u5bf9\u6570<\/td>\n<td>log(exp(1))&#061;1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8bb0\u5fc6\u53e3\u8bc0&#xff1a;<\/p>\n<p>exp \u662f e \u7684\u6307\u6570\u51fd\u6570&#xff0c;\u96f6\u6b21\u65b9\u7b49\u4e8e1&#xff0c;\u8fd4\u56de\u7c7b\u578b\u662f double\u3002<\/p>\n<hr \/>\n<h3 style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004172521-6ac28c01c7dde.png\" \/><\/h3>\n<hr \/>\n<h3>\u7b2c2\u9898&#xff1a;\u5f00\u653e\u5b9a\u5740\u6cd5\u5220\u9664\u5143\u7d20<\/h3>\n<p>\u274c\ufe0f \u9519\u8bef<\/p>\n<p>\u9898\u76ee&#xff1a;<\/p>\n<p>\u91c7\u7528\u5f00\u653e\u5b9a\u5740\u6cd5\u5904\u7406\u51b2\u7a81\u7684\u54c8\u5e0c\u8868\u4e2d&#xff0c;\u5220\u9664\u4e00\u4e2a\u5143\u7d20\u540e\u53ef\u4ee5\u76f4\u63a5\u5c06\u8be5\u4f4d\u7f6e\u7f6e\u7a7a&#xff0c;\u4e0d\u4f1a\u5f71\u54cd\u540e\u7eed\u67e5\u627e\u3002<\/p>\n<hr \/>\n<p>\u8fd9\u9053\u9898\u8003\u67e5\u54c8\u5e0c\u8868\u4e2d\u4e00\u4e2a\u975e\u5e38\u91cd\u8981\u7684\u7ec6\u8282&#xff1a;\u5220\u9664\u5143\u7d20\u65f6&#xff0c;\u4e0d\u80fd\u968f\u4fbf\u628a\u4f4d\u7f6e\u6e05\u7a7a&#xff01;<\/p>\n<h4>\u7b2c\u4e00\u6b65&#xff1a;\u5148\u8ba4\u8bc6\u54c8\u5e0c\u8868<\/h4>\n<p>\u6211\u4eec\u53ef\u4ee5\u628a\u54c8\u5e0c\u8868\u60f3\u8c61\u6210\u4e00\u4e2a\u5e26\u7f16\u53f7\u7684\u50a8\u7269\u67dc\u3002<\/p>\n<p>\u6bcf\u4e2a\u6570\u636e\u7ecf\u8fc7\u54c8\u5e0c\u51fd\u6570\u8ba1\u7b97\u540e&#xff0c;\u5c31\u4f1a\u5f97\u5230\u4e00\u4e2a\u67dc\u5b50\u7f16\u53f7\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>C&#043;&#043;<\/p>\n<p>int pos &#061; x % 10;<\/p>\n<p>\u5982\u679c&#xff1a;<\/p>\n<p>C&#043;&#043;<\/p>\n<p>x &#061; 23;<\/p>\n<p>\u90a3\u4e48&#xff1a;<\/p>\n<p>C&#043;&#043;<\/p>\n<p>pos &#061; 23 % 10 &#061; 3;<\/p>\n<p>\u4e8e\u662f&#xff0c;\u6570\u5b5723\u5c31\u60f3\u5b58\u5165\u7f16\u53f73\u7684\u67dc\u5b50\u3002<\/p>\n<p>\u4f46\u662f&#xff0c;\u5982\u679c\u7f16\u53f73\u5df2\u7ecf\u6709\u4eba\u4e86\u600e\u4e48\u529e&#xff1f;<\/p>\n<p>\u8fd9\u5c31\u53d1\u751f\u4e86\u54c8\u5e0c\u51b2\u7a81\u3002<\/p>\n<hr \/>\n<h4>\u7b2c\u4e8c\u6b65&#xff1a;\u4ec0\u4e48\u662f\u5f00\u653e\u5b9a\u5740\u6cd5&#xff1f;<\/h4>\n<p>\u5f00\u653e\u5b9a\u5740\u6cd5\u7684\u601d\u8def\u662f&#xff1a;<\/p>\n<p>\u5982\u679c\u539f\u6765\u7684\u4f4d\u7f6e\u88ab\u5360\u7528\u4e86&#xff0c;\u5c31\u7ee7\u7eed\u5bfb\u627e\u5176\u4ed6\u7a7a\u4f4d\u7f6e\u3002<\/p>\n<p>\u5047\u8bbe23\u548c33\u53d1\u751f\u51b2\u7a81&#xff0c;33\u7ecf\u8fc7\u63a2\u6d4b\u540e\u5b58\u653e\u5728\u4f4d\u7f6e4\u3002<\/p>\n<p>\u73b0\u5728&#xff0c;\u6211\u4eec\u60f3\u67e5\u627e33\u3002<\/p>\n<p>\u67e5\u627e\u8fc7\u7a0b&#xff1a;<\/p>\n<li>\n<p>\u5148\u8ba1\u7b9733\u7684\u54c8\u5e0c\u4f4d\u7f6e&#xff0c;\u5f97\u52303\u3002<\/p>\n<\/li>\n<li>\n<p>\u53d1\u73b0\u4f4d\u7f6e3\u5b58\u653e\u7684\u662f23&#xff0c;\u4e0d\u662f33\u3002<\/p>\n<\/li>\n<li>\n<p>\u6309\u7167\u5f00\u653e\u5b9a\u5740\u6cd5\u7ee7\u7eed\u5411\u540e\u5bfb\u627e\u3002<\/p>\n<\/li>\n<li>\n<p>\u627e\u5230\u4f4d\u7f6e4&#xff0c;\u53d1\u73b033&#xff0c;\u67e5\u627e\u6210\u529f\u3002<\/p>\n<\/li>\n<hr \/>\n<h4>\u7b2c\u4e09\u6b65&#xff1a;\u4e3a\u4ec0\u4e48\u4e0d\u80fd\u76f4\u63a5\u5220\u9664&#xff1f;<\/h4>\n<p>\u5047\u8bbe\u6211\u4eec\u5220\u966423&#xff0c;\u76f4\u63a5\u628a\u4f4d\u7f6e3\u6e05\u7a7a&#xff1a;<\/p>\n<p>\u9519\u8bef\u5220\u9664\u540e&#xff0c;<\/p>\n<p>\u73b0\u5728\u67e5\u627e33\u4f1a\u51fa\u73b0\u95ee\u9898&#xff01;<\/p>\n<p>\u67e5\u627e\u7a0b\u5e8f\u5148\u68c0\u67e5\u4f4d\u7f6e3&#xff0c;\u53d1\u73b0\u5b83\u662f\u7a7a\u7684&#xff0c;\u5c31\u53ef\u80fd\u8ba4\u4e3a33\u6839\u672c\u4e0d\u5b58\u5728&#xff0c;\u4e8e\u662f\u505c\u6b62\u67e5\u627e\u3002\u4f4633\u5b9e\u9645\u4e0a\u8fd8\u5728\u4f4d\u7f6e4\u3002<\/p>\n<p>\u8fd9\u5c31\u662f\u9519\u8bef\u7684\u5730\u65b9\u3002<\/p>\n<hr \/>\n<h3 style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004172521-6ac28c01dd73c.png\" \/><\/h3>\n<hr \/>\n<h3>\u7b2c3\u9898&#xff1a;\u54c8\u592b\u66fc\u6811\u4e2d&#xff0c;\u51fa\u73b0\u6b21\u6570\u66f4\u591a\u7684\u53f6\u5b50\u7ed3\u70b9&#xff0c;\u5176\u6df1\u5ea6\u603b\u662f\u66f4\u5c0f<\/h3>\n<p>\u274c\ufe0f \u9519\u8bef<\/p>\n<p>\u8fd9\u9053\u9898\u8003\u67e5\u54c8\u592b\u66fc\u6811&#xff0c;\u4e5f\u662f\u4e03\u7ea7\u4e2d\u975e\u5e38\u503c\u5f97\u638c\u63e1\u7684\u77e5\u8bc6\u70b9\u3002<\/p>\n<hr \/>\n<h4>\u7b2c\u4e00\u6b65&#xff1a;\u5148\u8ba4\u8bc6\u54c8\u592b\u66fc\u6811<\/h4>\n<p>\u5047\u8bbe\u6211\u4eec\u6709\u4e00\u4e2a\u6587\u5b57\u538b\u7f29\u4efb\u52a1\u3002<\/p>\n<p>\u73b0\u5728\u6709\u56db\u4e2a\u5b57\u6bcd&#xff0c;\u5b83\u4eec\u51fa\u73b0\u7684\u6b21\u6570\u4e0d\u540c&#xff1a;<\/p>\n<table>\n<tr>\u5b57\u6bcd\u51fa\u73b0\u6b21\u6570<\/tr>\n<tbody>\n<tr>\n<td>A<\/td>\n<td>40<\/td>\n<\/tr>\n<tr>\n<td>B<\/td>\n<td>30<\/td>\n<\/tr>\n<tr>\n<td>C<\/td>\n<td>20<\/td>\n<\/tr>\n<tr>\n<td>D<\/td>\n<td>10<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5982\u679c\u67d0\u4e2a\u5b57\u6bcd\u51fa\u73b0\u5f97\u7279\u522b\u9891\u7e41&#xff0c;\u6211\u4eec\u5e0c\u671b\u7ed9\u5b83\u5b89\u6392\u6bd4\u8f83\u77ed\u7684\u7f16\u7801\u3002<\/p>\n<p>\u5982\u679c\u67d0\u4e2a\u5b57\u6bcd\u5f88\u5c11\u51fa\u73b0&#xff0c;\u5c31\u53ef\u4ee5\u7ed9\u5b83\u5b89\u6392\u7a0d\u957f\u7684\u7f16\u7801\u3002<\/p>\n<p>\u8fd9\u6837\u6574\u4f53\u7f16\u7801\u957f\u5ea6\u5c31\u80fd\u5c3d\u91cf\u77ed\u3002<\/p>\n<p>\u8fd9\u5c31\u662f\u54c8\u592b\u66fc\u7f16\u7801\u7684\u6838\u5fc3\u601d\u60f3\u3002<\/p>\n<hr \/>\n<h4>\u7b2c\u4e8c\u6b65&#xff1a;\u54c8\u592b\u66fc\u6811\u600e\u4e48\u5efa\u7acb&#xff1f;<\/h4>\n<p>\u54c8\u592b\u66fc\u6811\u7684\u5efa\u6811\u65b9\u6cd5\u662f&#xff1a;<\/p>\n<p>\u6bcf\u6b21\u9009\u51fa\u6743\u503c\u6700\u5c0f\u7684\u4e24\u4e2a\u7ed3\u70b9&#xff0c;\u5408\u5e76\u6210\u4e00\u4e2a\u65b0\u7ed3\u70b9\u3002<\/p>\n<p>\u5bf9\u4e8e\u4e0a\u9762\u7684\u4f8b\u5b50&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u7b2c\u4e00\u6b21&#xff1a;10\u548c20\u5408\u5e76&#xff0c;\u5f97\u523030\u3002<\/p>\n<\/li>\n<li>\n<p>\u7b2c\u4e8c\u6b21&#xff1a;30\u548c30\u5408\u5e76&#xff0c;\u5f97\u523060\u3002<\/p>\n<\/li>\n<li>\n<p>\u7b2c\u4e09\u6b21&#xff1a;40\u548c60\u5408\u5e76&#xff0c;\u5f97\u5230100\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u53ef\u4ee5\u753b\u6210\u4e00\u68f5\u6811&#xff1a;<\/p>\n<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\u6570\u636e\u7ed3\u6784\u56fe\u6587\u89e3\u6790\u4e4b\uff1a\u54c8\u592b\u66fc\u6811\u4e0e\u54c8\u592b\u66fc\u7f16\u7801\u8be6\u89e3\u53caC++\u6a21\u677f\u5b9e\u73b0 - melonstreet - \u535a\u5ba2\u56ed\" height=\"409\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004172521-6ac28c01f2f3c.jpg\" width=\"759\" \/><\/p>\n<hr \/>\n<h4>\u7b2c\u4e09\u6b65&#xff1a;\u51fa\u73b0\u6b21\u6570\u8d8a\u591a&#xff0c;\u6df1\u5ea6\u4e00\u5b9a\u8d8a\u5c0f\u5417&#xff1f;<\/h4>\n<p>\u9898\u76ee\u4e2d\u6700\u5173\u952e\u7684\u662f\u4e24\u4e2a\u5b57&#xff1a;<\/p>\n<p>\u603b\u662f\u3002<\/p>\n<p>\u54c8\u592b\u66fc\u6811\u7684\u76ee\u6807\u662f\u8ba9\u51fa\u73b0\u9891\u7387\u9ad8\u7684\u5b57\u7b26\u5c3d\u53ef\u80fd\u4f7f\u7528\u8f83\u77ed\u7684\u7f16\u7801&#xff0c;\u4f46\u4e0d\u80fd\u56e0\u6b64\u7b80\u5355\u5730\u8bf4\u6bcf\u4e2a\u9891\u7387\u66f4\u9ad8\u7684\u53f6\u5b50\u7ed3\u70b9\u90fd\u5fc5\u7136\u6bd4\u5176\u4ed6\u53f6\u5b50\u7ed3\u70b9\u6d45\u3002<\/p>\n<p>\u4e3e\u4e00\u4e2a\u7279\u6b8a\u60c5\u51b5&#xff1a;<\/p>\n<p>\u5047\u8bbe\u53ea\u6709\u4e24\u4e2a\u5b57\u7b26&#xff1a;<\/p>\n<table>\n<tr>\u5b57\u6bcd\u51fa\u73b0\u6b21\u6570<\/tr>\n<tbody>\n<tr>\n<td>A<\/td>\n<td>5<\/td>\n<\/tr>\n<tr>\n<td>B<\/td>\n<td>6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u90a3\u4e48\u5efa\u7acb\u51fa\u6765\u7684\u54c8\u592b\u66fc\u6811\u662f&#xff1a;<\/p>\n<p>       11<br \/>\n      \/  \\\\<br \/>\n     A    B<\/p>\n<p>A\u548cB\u7684\u6df1\u5ea6\u90fd\u662f1\u3002<\/p>\n<p>\u5b83\u4eec\u51fa\u73b0\u6b21\u6570\u4e0d\u540c&#xff0c;\u4f46\u662f\u6df1\u5ea6\u76f8\u540c\u3002<\/p>\n<p>\u6240\u4ee5&#xff0c;\u4e0d\u80fd\u628a\u201c\u9891\u7387\u8d8a\u9ad8&#xff0c;\u6df1\u5ea6\u603b\u662f\u4e25\u683c\u66f4\u5c0f\u201d\u5f53\u6210\u7edd\u5bf9\u89c4\u5f8b\u3002<\/p>\n<p>\u672c\u9898\u7ed3\u8bba&#xff1a;\u9519\u8bef\u274c\ufe0f\u3002<\/p>\n<hr \/>\n<h4>\u7b2c\u56db\u6b65&#xff1a;\u771f\u6b63\u9700\u8981\u8bb0\u4f4f\u4ec0\u4e48&#xff1f;<\/h4>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004172522-6ac28c0212f6b.png\" \/><\/p>\n<hr \/>\n<p>\u8bb0\u5fc6\u53e3\u8bc0&#xff1a;<\/p>\n<p>\u54c8\u592b\u66fc\u6811&#xff0c;\u627e\u6700\u5c0f&#xff1b;\u4e24\u4e2a\u5408\u5e76&#xff0c;\u518d\u627e\u6700\u5c0f&#xff1b;\u76ee\u6807\u662f\u8ba9WPL\u6700\u5c0f\u3002<\/p>\n<hr \/>\n<h3 style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004172522-6ac28c022350c.png\" \/><\/h3>\n<h3>\u7b2c4\u9898&#xff1a;\u6709\u5411\u56fe\u4e2d&#xff0c;\u6240\u6709\u9876\u70b9\u7684\u5165\u5ea6\u4e4b\u548c\u7b49\u4e8e\u6240\u6709\u9876\u70b9\u7684\u51fa\u5ea6\u4e4b\u548c<\/h3>\n<p>\u2705\ufe0f \u6b63\u786e<\/p>\n<p>\u8fd9\u9053\u9898\u8003\u67e5\u56fe\u8bba\u4e2d\u7684\u5165\u5ea6\u548c\u51fa\u5ea6\u3002<\/p>\n<hr \/>\n<h4>\u7b2c\u4e00\u6b65&#xff1a;\u4ec0\u4e48\u662f\u6709\u5411\u56fe&#xff1f;<\/h4>\n<p>\u6709\u5411\u56fe\u53ef\u4ee5\u7406\u89e3\u6210\u4e00\u4e2a\u5355\u5411\u9053\u8def\u7f51\u7edc\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>A &#8212;-&gt; B<br \/>\n \\\\      |<br \/>\n  \\\\     v<br \/>\n   &#8212;&gt; C<\/p>\n<p>\u7bad\u5934\u8868\u793a\u9053\u8def\u53ea\u80fd\u671d\u4e00\u4e2a\u65b9\u5411\u8d70\u3002<\/p>\n<hr \/>\n<h4>\u7b2c\u4e8c\u6b65&#xff1a;\u4ec0\u4e48\u662f\u5165\u5ea6\u548c\u51fa\u5ea6&#xff1f;<\/h4>\n<p>\u5bf9\u4e8e\u4e00\u4e2a\u9876\u70b9&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u5165\u5ea6&#xff1a;\u6709\u591a\u5c11\u6761\u8fb9\u6307\u5411\u5b83\u3002<\/p>\n<\/li>\n<li>\n<p>\u51fa\u5ea6&#xff1a;\u6709\u591a\u5c11\u6761\u8fb9\u4ece\u5b83\u51fa\u53d1\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>A &#8212;-&gt; B<br \/>\n \\\\      |<br \/>\n  \\\\     v<br \/>\n   &#8212;&gt; C<\/p>\n<p>\u6211\u4eec\u6570\u4e00\u4e0b&#xff1a;<\/p>\n<table>\n<tr>\u9876\u70b9\u5165\u5ea6\u51fa\u5ea6<\/tr>\n<tbody>\n<tr>\n<td>A<\/td>\n<td>0<\/td>\n<td>2<\/td>\n<\/tr>\n<tr>\n<td>B<\/td>\n<td>1<\/td>\n<td>1<\/td>\n<\/tr>\n<tr>\n<td>C<\/td>\n<td>2<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td>\u5408\u8ba1<\/td>\n<td>3<\/td>\n<td>3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<p>\u6240\u6709\u9876\u70b9\u7684\u5165\u5ea6\u4e4b\u548c&#xff1a;<\/p>\n<p>0&#043;1&#043;2 &#061; 3\u00a0<\/p>\n<p>\u6240\u6709\u9876\u70b9\u7684\u51fa\u5ea6\u4e4b\u548c&#xff1a;<\/p>\n<p>2&#043;1&#043;0 &#061; 3<\/p>\n<p>\u4e24\u8005\u76f8\u7b49&#xff01;<\/p>\n<hr \/>\n<h4>\u7b2c\u4e09\u6b65&#xff1a;\u4e3a\u4ec0\u4e48\u4e00\u5b9a\u76f8\u7b49&#xff1f;<\/h4>\n<p>\u6211\u4eec\u6362\u4e00\u79cd\u601d\u8003\u65b9\u5f0f\u3002<\/p>\n<p>\u5047\u8bbe\u6574\u4e2a\u56fe\u670910\u6761\u6709\u5411\u8fb9\u3002<\/p>\n<p>\u6bcf\u4e00\u6761\u6709\u5411\u8fb9&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u4e00\u5b9a\u4ece\u4e00\u4e2a\u9876\u70b9\u51fa\u53d1&#xff0c;\u6240\u4ee5\u8d21\u732e1\u6b21\u51fa\u5ea6\u3002<\/p>\n<\/li>\n<li>\n<p>\u4e00\u5b9a\u6307\u5411\u53e6\u4e00\u4e2a\u9876\u70b9&#xff0c;\u6240\u4ee5\u8d21\u732e1\u6b21\u5165\u5ea6\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u56e0\u6b64&#xff1a;<\/p>\n<p>\u6bcf\u6761\u8fb9\u90fd\u7ed9\u51fa\u5ea6\u603b\u548c\u8d21\u732e1&#xff0c;\u4e5f\u7ed9\u5165\u5ea6\u603b\u548c\u8d21\u732e1\u3002<\/p>\n<p>\u5982\u679c\u56fe\u4e2d\u6709 m\u00a0\u00a0\u6761\u8fb9&#xff0c;\u90a3\u4e48&#xff1a;<\/p>\n<p>\u2211\u5165\u5ea6 &#061; m\u00a0<\/p>\n<p>\u2211\u51fa\u5ea6 &#061; m<\/p>\n<p>\u6240\u4ee5&#xff1a;<\/p>\n<p>\u2211\u5165\u5ea6 &#061; \u2211\u51fa\u5ea6<\/p>\n<hr \/>\n<h4>\u7b2c\u56db\u6b65&#xff1a;\u4e3e\u4e00\u53cd\u4e09<\/h4>\n<p>\u6ce8\u610f&#xff0c;\u8fd9\u4e2a\u7ed3\u8bba\u5bf9\u6709\u5411\u56fe\u6210\u7acb\u3002<\/p>\n<p>\u5bf9\u4e8e\u65e0\u5411\u56fe&#xff0c;\u6bcf\u6761\u8fb9\u8fde\u63a5\u4e24\u4e2a\u9876\u70b9&#xff0c;\u5bf9\u603b\u5ea6\u6570\u8d21\u732e2&#xff0c;\u56e0\u6b64&#xff1a;<\/p>\n<p>\u2211\u5ea6\u6570 &#061; 2m<\/p>\n<p>\u8bb0\u5fc6\u53e3\u8bc0&#xff1a;<\/p>\n<p>\u6709\u5411\u56fe\u4e2d&#xff0c;\u5165\u5ea6\u603b\u548c\u7b49\u4e8e\u51fa\u5ea6\u603b\u548c&#xff1b;\u65e0\u5411\u56fe\u4e2d&#xff0c;\u6240\u6709\u5ea6\u6570\u52a0\u8d77\u6765\u7b49\u4e8e\u8fb9\u6570\u7684\u4e24\u500d\u3002<\/p>\n<hr \/>\n<h3 style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004172522-6ac28c0235c3e.png\" \/><\/h3>\n<hr \/>\n<h3>\u7b2c5\u9898&#xff1a;BFS\u4f7f\u7528\u961f\u5217&#xff0c;DFS\u4f7f\u7528\u6808\u6216\u9012\u5f52<\/h3>\n<p>\u2705\ufe0f\u6b63\u786e<\/p>\n<p>\u8fd9\u9053\u9898\u8003\u67e5\u4e86\u56fe\u8bba\u4e2d\u4e24\u79cd\u7ecf\u5178\u641c\u7d22\u7b97\u6cd5\u3002<\/p>\n<hr \/>\n<h4>\u7b2c\u4e00\u6b65&#xff1a;\u4ec0\u4e48\u662fBFS&#xff1f;<\/h4>\n<p>BFS&#xff0c;\u5168\u79f0&#xff1a;<\/p>\n<p>Breadth First Search<\/p>\n<p>\u4e2d\u6587\u53eb\u4f5c&#xff1a;\u5e7f\u5ea6\u4f18\u5148\u641c\u7d22\u3002<\/p>\n<hr \/>\n<p>\u6211\u4eec\u53ef\u4ee5\u628a\u5b83\u60f3\u8c61\u6210\u4e00\u5757\u77f3\u5934\u6254\u8fdb\u6c34\u6c60\u91cc\u3002<\/p>\n<p>\u6c34\u6ce2\u4ece\u4e2d\u5fc3\u5411\u56db\u5468\u6269\u6563&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u7b2c\u4e00\u5708&#xff1a;\u8ddd\u79bb\u8d77\u70b91\u6b65\u7684\u70b9\u3002<\/p>\n<\/li>\n<li>\n<p>\u7b2c\u4e8c\u5708&#xff1a;\u8ddd\u79bb\u8d77\u70b92\u6b65\u7684\u70b9\u3002<\/p>\n<\/li>\n<li>\n<p>\u7b2c\u4e09\u5708&#xff1a;\u8ddd\u79bb\u8d77\u70b93\u6b65\u7684\u70b9\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u4e00\u5c42\u4e00\u5c42\u5411\u5916\u6269\u5c55\u3002<\/p>\n<hr \/>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"BFS vs DFS: Diferencias Clave | Learn Graph Theory\" height=\"860\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004172522-6ac28c024a787.jpg\" width=\"1433\" \/><\/p>\n<hr \/>\n<p>BFS\u7684\u7279\u70b9\u662f&#xff1a;<\/p>\n<p>\u5148\u53d1\u73b0\u7684\u70b9&#xff0c;\u5148\u5904\u7406\u3002<\/p>\n<p>\u8fd9\u548c\u6392\u961f\u4e70\u7968\u975e\u5e38\u76f8\u4f3c\u3002<\/p>\n<p>\u56e0\u6b64&#xff0c;BFS\u901a\u5e38\u4f7f\u7528 queue \u961f\u5217\u3002<\/p>\n<hr \/>\n<p>\u53c2\u8003\u4ee3\u7801&#xff1a;<\/p>\n<p>#include &lt;iostream&gt;<br \/>\n#include &lt;queue&gt;<br \/>\nusing namespace std;<\/p>\n<p>int main() {<br \/>\n    queue&lt;int&gt; q;<\/p>\n<p>    q.push(1);<br \/>\n    q.push(2);<br \/>\n    q.push(3);<\/p>\n<p>    while (!q.empty()) {<br \/>\n        int x &#061; q.front();<br \/>\n        q.pop();<\/p>\n<p>        cout &lt;&lt; x &lt;&lt; &#034; &#034;;<br \/>\n    }<\/p>\n<p>    return 0;<br \/>\n}<\/p>\n<p>\u8f93\u51fa&#xff1a;<\/p>\n<p>1 2 3<\/p>\n<p>\u961f\u5217\u7684\u7279\u70b9\u662f&#xff1a;<\/p>\n<p>\u5148\u8fdb\u5148\u51fa&#xff08;FIFO&#xff09;\u3002<\/p>\n<hr \/>\n<h4>\u7b2c\u4e8c\u6b65&#xff1a;\u4ec0\u4e48\u662fDFS&#xff1f;<\/h4>\n<p>DFS&#xff0c;\u5168\u79f0&#xff1a;<\/p>\n<p>Depth First Search<\/p>\n<p>\u4e2d\u6587\u53eb\u4f5c&#xff1a;\u6df1\u5ea6\u4f18\u5148\u641c\u7d22\u3002<\/p>\n<p>\u53ef\u4ee5\u628a\u5b83\u60f3\u8c61\u6210\u4e00\u4e2a\u63a2\u9669\u5bb6\u8fdb\u5165\u8ff7\u5bab\u3002<\/p>\n<p>\u63a2\u9669\u5bb6\u9047\u5230\u5c94\u8def\u53e3\u65f6&#xff1a;<\/p>\n<li>\n<p>\u5148\u9009\u62e9\u4e00\u6761\u8def\u3002<\/p>\n<\/li>\n<li>\n<p>\u6cbf\u7740\u8fd9\u6761\u8def\u4e00\u76f4\u5f80\u524d\u8d70\u3002<\/p>\n<\/li>\n<li>\n<p>\u8d70\u4e0d\u901a\u4e86&#xff0c;\u5c31\u9000\u56de\u4e0a\u4e00\u4e2a\u5c94\u8def\u53e3\u3002<\/p>\n<\/li>\n<li>\n<p>\u518d\u5c1d\u8bd5\u5176\u4ed6\u9053\u8def\u3002<\/p>\n<\/li>\n<p>\u8fd9\u5c31\u662f\u6df1\u5ea6\u4f18\u5148\u641c\u7d22\u3002<\/p>\n<hr \/>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"BFS vs DFS: Diferencias Clave | Learn Graph Theory\" height=\"860\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004172522-6ac28c0294c1c.jpg\" width=\"1433\" \/><\/p>\n<hr \/>\n<p>DFS\u901a\u5e38\u6709\u4e24\u79cd\u5b9e\u73b0\u65b9\u5f0f&#xff1a;<\/p>\n<p>\u65b9\u5f0f\u4e00&#xff1a;\u9012\u5f52<\/p>\n<p>C&#043;&#043;<\/p>\n<p>void dfs(int x) {<br \/>\n    vis[x] &#061; 1;<\/p>\n<p>    for (int i &#061; 0; i &lt; n; i&#043;&#043;) {<br \/>\n        if (!vis[i] &amp;&amp; \u6709\u8fb9) {<br \/>\n            dfs(i);<br \/>\n        }<br \/>\n    }<br \/>\n}<\/p>\n<p>\u9012\u5f52\u8c03\u7528\u4f1a\u4f7f\u7528\u7cfb\u7edf\u63d0\u4f9b\u7684\u8c03\u7528\u6808\u3002<\/p>\n<hr \/>\n<p>\u65b9\u5f0f\u4e8c&#xff1a;\u624b\u52a8\u4f7f\u7528\u6808<\/p>\n<p>C&#043;&#043;<\/p>\n<p>stack&lt;int&gt; s;<\/p>\n<p>s.push(1);<\/p>\n<p>while (!s.empty()) {<br \/>\n    int x &#061; s.top();<br \/>\n    s.pop();<\/p>\n<p>    \/\/ \u5904\u7406\u7ed3\u70b9x<br \/>\n}<\/p>\n<p>\u6808\u7684\u7279\u70b9\u662f&#xff1a;<\/p>\n<p>\u540e\u8fdb\u5148\u51fa&#xff08;LIFO&#xff09;\u3002<\/p>\n<hr \/>\n<h4>\u7b2c\u4e09\u6b65&#xff1a;BFS\u548cDFS\u5bf9\u6bd4<\/h4>\n<table>\n<tr>\u6bd4\u8f83\u9879\u76eeBFSDFS<\/tr>\n<tbody>\n<tr>\n<td>\u4e2d\u6587\u540d\u79f0<\/td>\n<td>\u5e7f\u5ea6\u4f18\u5148\u641c\u7d22<\/td>\n<td>\u6df1\u5ea6\u4f18\u5148\u641c\u7d22<\/td>\n<\/tr>\n<tr>\n<td>\u641c\u7d22\u65b9\u5f0f<\/td>\n<td>\u4e00\u5c42\u4e00\u5c42\u6269\u5c55<\/td>\n<td>\u4e00\u6761\u8def\u8d70\u5230\u5e95<\/td>\n<\/tr>\n<tr>\n<td>\u5e38\u7528\u6570\u636e\u7ed3\u6784<\/td>\n<td>queue<\/td>\n<td>stack<\/td>\n<\/tr>\n<tr>\n<td>\u9012\u5f52\u5b9e\u73b0<\/td>\n<td>\u901a\u5e38\u4e0d\u9700\u8981<\/td>\n<td>\u5f88\u5e38\u89c1<\/td>\n<\/tr>\n<tr>\n<td>\u65e0\u6743\u56fe\u6700\u77ed\u8def<\/td>\n<td>\u53ef\u4ee5\u6c42<\/td>\n<td>\u901a\u5e38\u4e0d\u80fd\u76f4\u63a5\u4fdd\u8bc1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<p>\u8bb0\u5fc6\u53e3\u8bc0&#xff1a;<\/p>\n<p>BFS\u50cf\u6c34\u6ce2&#xff0c;\u961f\u5217\u6765\u5e2e\u5fd9&#xff1b;DFS\u50cf\u63a2\u9669&#xff0c;\u9012\u5f52\u6216\u6808\u767b\u573a\u3002<\/p>\n<hr \/>\n<h3 style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004172522-6ac28c02e361f.png\" \/><\/h3>\n<hr \/>\n<h3>\u7b2c6\u9898&#xff1a;\u5feb\u901f\u6392\u5e8f\u7684\u5e73\u5747\u65f6\u95f4\u590d\u6742\u5ea6\u548c\u6700\u574f\u65f6\u95f4\u590d\u6742\u5ea6\u90fd\u662f O(n log n)<\/h3>\n<p>\u274c\ufe0f\u9519\u8bef<\/p>\n<p>\u8fd9\u9053\u9898\u662f\u65f6\u95f4\u590d\u6742\u5ea6\u4e2d\u7684\u7ecf\u5178\u9677\u9631\u3002<\/p>\n<hr \/>\n<h4>\u7b2c\u4e00\u6b65&#xff1a;\u5148\u8ba4\u8bc6\u5feb\u901f\u6392\u5e8f<\/h4>\n<p>\u5feb\u901f\u6392\u5e8f\u7684\u57fa\u672c\u601d\u60f3\u662f&#xff1a;<\/p>\n<p>\u627e\u4e00\u4e2a\u57fa\u51c6\u6570&#xff08;pivot&#xff09;&#xff0c;\u628a\u6570\u7ec4\u5206\u6210\u4e24\u90e8\u5206&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u4e00\u90e8\u5206\u6bd4\u57fa\u51c6\u6570\u5c0f\u3002<\/p>\n<\/li>\n<li>\n<p>\u53e6\u4e00\u90e8\u5206\u6bd4\u57fa\u51c6\u6570\u5927\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u7136\u540e\u5bf9\u5de6\u53f3\u4e24\u90e8\u5206\u7ee7\u7eed\u8fdb\u884c\u5feb\u901f\u6392\u5e8f\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>8 3 6 2 9 1 5<\/p>\n<p>\u5047\u8bbe\u9009\u62e95\u4f5c\u4e3a\u57fa\u51c6\u6570\u3002<\/p>\n<p>\u5206\u533a\u540e\u53ef\u4ee5\u5f97\u5230&#xff1a;<\/p>\n<p>3 2 1 | 5 | 8 6 9<\/p>\n<p>\u63a5\u7740\u5206\u522b\u5904\u7406\u5de6\u53f3\u4e24\u8fb9\u3002<\/p>\n<hr \/>\n<h4>\u7b2c\u4e8c\u6b65&#xff1a;\u4ec0\u4e48\u662f\u5e73\u5747\u65f6\u95f4\u590d\u6742\u5ea6&#xff1f;<\/h4>\n<p>\u5982\u679c\u6bcf\u6b21\u5206\u533a\u90fd\u6bd4\u8f83\u5747\u5300&#xff1a;<\/p>\n<p>          8\u4e2a\u6570<br \/>\n         \/     \\\\<br \/>\n      4\u4e2a\u6570    3\u4e2a\u6570<br \/>\n      \/  \\\\      \/ \\\\<br \/>\n     2    1    1   1<\/p>\n<p>\u6bcf\u4e00\u5c42\u5904\u7406\u6240\u6709\u5143\u7d20&#xff0c;\u5927\u7ea6\u9700\u8981 O(n)\u00a0\u7684\u65f6\u95f4\u3002<\/p>\n<p>\u800c\u6811\u7684\u5c42\u6570\u5927\u7ea6\u662f&#xff1a;<\/p>\n<p>O(log\u2061n)<\/p>\n<p>\u6240\u4ee5\u5e73\u5747\u65f6\u95f4\u590d\u6742\u5ea6\u4e3a&#xff1a;<\/p>\n<p>O(nlog\u2061n)<\/p>\n<hr \/>\n<h4>\u7b2c\u4e09\u6b65&#xff1a;\u6700\u574f\u60c5\u51b5\u662f\u4ec0\u4e48&#xff1f;<\/h4>\n<p>\u5982\u679c\u6bcf\u6b21\u9009\u62e9\u7684\u57fa\u51c6\u6570\u90fd\u7279\u522b\u5dee&#xff0c;\u5bfc\u81f4\u4e00\u8fb9\u6709 n\u22121n-1n\u22121 \u4e2a\u6570&#xff0c;\u53e6\u4e00\u8fb9\u6ca1\u6709\u6570&#xff1a;<\/p>\n<p>        9<br \/>\n       \/<br \/>\n      8<br \/>\n     \/<br \/>\n    7<br \/>\n   \/<br \/>\n  6<br \/>\n \/<br \/>\n&#8230;<\/p>\n<p>\u5c31\u50cf\u4e00\u4e2a\u6b6a\u5f97\u975e\u5e38\u5389\u5bb3\u7684\u6811\u3002<\/p>\n<p>\u6b64\u65f6&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u7b2c\u4e00\u6b21\u5904\u7406 nnn \u4e2a\u6570\u3002<\/p>\n<\/li>\n<li>\n<p>\u7b2c\u4e8c\u6b21\u5904\u7406 n\u22121\u4e2a\u6570\u3002<\/p>\n<\/li>\n<li>\n<p>\u7b2c\u4e09\u6b21\u5904\u7406 n\u22122\u4e2a\u6570\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u603b\u65f6\u95f4\u5927\u7ea6\u662f&#xff1a;<\/p>\n<p>n&#043;(n\u22121)&#043;(n\u22122)&#043;\u22ef&#043;1<\/p>\n<p>\u6839\u636e\u7b49\u5dee\u6570\u5217\u6c42\u548c&#xff1a;<\/p>\n<p>&#061;n(n&#043;1) \/ 2<\/p>\n<p>\u56e0\u6b64&#xff1a;<\/p>\n<p>O(n^2)<\/p>\n<hr \/>\n<h4>\u7b2c\u56db\u6b65&#xff1a;\u6b63\u786e\u7ed3\u8bba<\/h4>\n<table>\n<tr>\u60c5\u51b5\u5feb\u901f\u6392\u5e8f\u65f6\u95f4\u590d\u6742\u5ea6<\/tr>\n<tbody>\n<tr>\n<td>\u6700\u597d\u60c5\u51b5<\/td>\n<td>O(nlog\u2061n)<\/td>\n<\/tr>\n<tr>\n<td>\u5e73\u5747\u60c5\u51b5<\/td>\n<td>O(nlog\u2061n)<\/td>\n<\/tr>\n<tr>\n<td>\u6700\u574f\u60c5\u51b5<\/td>\n<td>O(n^2)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u9898\u76ee\u628a\u5e73\u5747\u60c5\u51b5\u548c\u6700\u574f\u60c5\u51b5\u90fd\u5199\u6210\u4e86 O(nlog\u2061n)&#xff0c;\u6240\u4ee5\u9519\u8bef\u3002<\/p>\n<hr \/>\n<p>\u8bb0\u5fc6\u53e3\u8bc0&#xff1a;<\/p>\n<p>\u5feb\u901f\u6392\u5e8f&#xff0c;\u5e73\u5747\u5f88\u5feb&#xff1b;\u6700\u574f\u9000\u5316&#xff0c;\u5e73\u65b9\u7b49\u5f85\u3002<\/p>\n<hr \/>\n<h3 style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004172523-6ac28c03058a1.png\" \/><\/h3>\n<hr \/>\n<h3>\u7b2c7\u9898&#xff1a;0\/1\u80cc\u5305\u4e00\u7ef4\u6570\u7ec4\u4f18\u5316\u65f6&#xff0c;\u5bb9\u91cf\u5e94\u8be5\u4ece\u5927\u5230\u5c0f\u679a\u4e3e<\/h3>\n<p>\u2705\ufe0f \u6b63\u786e<\/p>\n<p>\u8fd9\u9053\u9898\u662f\u52a8\u6001\u89c4\u5212\u4e2d\u7684\u7ecf\u5178\u8003\u70b9\u3002<\/p>\n<hr \/>\n<h4>\u7b2c\u4e00\u6b65&#xff1a;\u5148\u7406\u89e30\/1\u80cc\u5305<\/h4>\n<p>\u5047\u8bbe\u6211\u4eec\u6709\u4e00\u4e2a\u80cc\u5305&#xff0c;\u6700\u5927\u5bb9\u91cf\u4e3a8\u3002<\/p>\n<p>\u6709\u4e00\u4e2a\u5b9d\u7269&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u91cd\u91cf&#xff1a;3<\/p>\n<\/li>\n<li>\n<p>\u4ef7\u503c&#xff1a;5<\/p>\n<\/li>\n<\/ul>\n<p>\u8fd9\u4e2a\u5b9d\u7269\u53ea\u80fd\u62ff\u4e00\u6b21\u3002<\/p>\n<p>\u6211\u4eec\u5e0c\u671b\u5728\u4e0d\u8d85\u8fc7\u80cc\u5305\u5bb9\u91cf\u7684\u524d\u63d0\u4e0b&#xff0c;\u83b7\u5f97\u5c3d\u53ef\u80fd\u5927\u7684\u4ef7\u503c\u3002<\/p>\n<p>\u8fd9\u5c31\u662f0\/1\u80cc\u5305\u95ee\u9898\u3002<\/p>\n<p>\u4e3a\u4ec0\u4e48\u53eb0\/1&#xff1f;<\/p>\n<p>\u56e0\u4e3a\u6bcf\u4e2a\u7269\u54c1\u53ea\u6709\u4e24\u79cd\u9009\u62e9&#xff1a;<\/p>\n<ul>\n<li>\n<p>0&#xff1a;\u4e0d\u62ff\u3002<\/p>\n<\/li>\n<li>\n<p>1&#xff1a;\u62ff\u4e00\u6b21\u3002<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<h4>\u7b2c\u4e8c\u6b65&#xff1a;\u4e8c\u7ef4DP\u600e\u4e48\u7406\u89e3&#xff1f;<\/h4>\n<p>\u5047\u8bbe&#xff1a;<\/p>\n<p>dp[i][c]<\/p>\n<p>\u8868\u793a\u8003\u8651\u524d i \u4e2a\u7269\u54c1&#xff0c;\u80cc\u5305\u5bb9\u91cf\u4e3a c \u65f6\u7684\u6700\u5927\u4ef7\u503c\u3002<\/p>\n<p>\u5982\u679c\u4f7f\u7528\u7b2c i \u4e2a\u7269\u54c1&#xff1a;<\/p>\n<p>dp[i][c]&#061;max(dp[i\u22121][c],dp[i\u22121][c\u2212wi\u200b]&#043;vi\u200b)<\/p>\n<p>\u5982\u679c\u4e0d\u4f7f\u7528&#xff1a;<\/p>\n<p>dp[i][c] &#061; dp[i\u22121][c]<\/p>\n<p>\u8fd9\u91cc\u7684\u5173\u952e\u662f&#xff1a;<\/p>\n<p>\u65e0\u8bba\u62ff\u4e0d\u62ff\u7b2ci\u4e2a\u7269\u54c1&#xff0c;\u90fd\u8981\u4ece\u4e0a\u4e00\u5c42\u72b6\u6001\u8f6c\u79fb\u3002<\/p>\n<hr \/>\n<h4>\u7b2c\u4e09\u6b65&#xff1a;\u4e3a\u4ec0\u4e48\u53ef\u4ee5\u538b\u7f29\u6210\u4e00\u7ef4\u6570\u7ec4&#xff1f;<\/h4>\n<p>\u6211\u4eec\u53d1\u73b0&#xff0c;\u8ba1\u7b97\u7b2c i \u5c42\u65f6&#xff0c;\u53ea\u9700\u8981\u7b2c i\u22121\u00a0\u5c42\u7684\u6570\u636e\u3002<\/p>\n<p>\u56e0\u6b64\u53ef\u4ee5\u4f7f\u7528\u4e00\u7ef4\u6570\u7ec4&#xff1a;<\/p>\n<p>C&#043;&#043;<\/p>\n<p>int dp[1005] &#061; {0};<\/p>\n<p>\u4f46\u662f&#xff0c;\u538b\u7f29\u540e\u6709\u4e00\u4e2a\u975e\u5e38\u91cd\u8981\u7684\u95ee\u9898&#xff1a;<\/p>\n<p>\u5bb9\u91cf\u5faa\u73af\u5fc5\u987b\u4ece\u5927\u5230\u5c0f&#xff01;<\/p>\n<p>C&#043;&#043;<\/p>\n<p>for (int c &#061; W; c &gt;&#061; w; c&#8211;) {<br \/>\n    dp[c] &#061; max(dp[c], dp[c &#8211; w] &#043; v);<br \/>\n}<\/p>\n<hr \/>\n<h4>\u7b2c\u56db\u6b65&#xff1a;\u4e3a\u4ec0\u4e48\u5fc5\u987b\u4ece\u5927\u5230\u5c0f&#xff1f;<\/h4>\n<p>\u8fd8\u662f\u4f7f\u7528\u91cd\u91cf3\u3001\u4ef7\u503c5\u7684\u5b9d\u7269&#xff0c;\u80cc\u5305\u5bb9\u91cf\u4e3a8\u3002<\/p>\n<p>\u5982\u679c\u4ece\u5927\u5230\u5c0f&#xff1a;<\/p>\n<p>c &#061; 8<br \/>\ndp[8] &#061; max(dp[8], dp[5] &#043; 5)<\/p>\n<p>c &#061; 7<br \/>\ndp[7] &#061; max(dp[7], dp[4] &#043; 5)<\/p>\n<p>c &#061; 6<br \/>\ndp[6] &#061; max(dp[6], dp[3] &#043; 5)<\/p>\n<p>c &#061; 5<br \/>\ndp[5] &#061; max(dp[5], dp[2] &#043; 5)<\/p>\n<p>c &#061; 4<br \/>\ndp[4] &#061; max(dp[4], dp[1] &#043; 5)<\/p>\n<p>c &#061; 3<br \/>\ndp[3] &#061; max(dp[3], dp[0] &#043; 5)<\/p>\n<p>\u7531\u4e8e\u4ece\u5927\u5230\u5c0f\u679a\u4e3e&#xff0c;\u66f4\u65b0 dp[8] \u65f6&#xff0c;dp[5] \u8fd8\u662f\u4e0a\u4e00\u8f6e\u7684\u6570\u636e&#xff0c;\u6ca1\u6709\u4f7f\u7528\u5f53\u524d\u7269\u54c1\u3002<\/p>\n<p>\u6240\u4ee5\u5f53\u524d\u7269\u54c1\u4e0d\u4f1a\u88ab\u91cd\u590d\u4f7f\u7528\u3002<\/p>\n<hr \/>\n<p>\u5982\u679c\u4ece\u5c0f\u5230\u5927\u5462&#xff1f;<\/p>\n<p>C&#043;&#043;<\/p>\n<p>for (int c &#061; w; c &lt;&#061; W; c&#043;&#043;) {<br \/>\n    dp[c] &#061; max(dp[c], dp[c &#8211; w] &#043; v);<br \/>\n}<\/p>\n<p>\u5f53\u8ba1\u7b97 dp[6] \u65f6&#xff0c;dp[3] \u5df2\u7ecf\u88ab\u5f53\u524d\u7269\u54c1\u66f4\u65b0\u8fc7\u4e86\u3002<\/p>\n<p>\u8fd9\u6837\u5c31\u76f8\u5f53\u4e8e\u53ef\u4ee5\u4f7f\u7528\u4e24\u6b21\u91cd\u91cf\u4e3a3\u7684\u7269\u54c1\u3002<\/p>\n<p>\u8fd9\u5c31\u53d8\u6210\u4e86\u5b8c\u5168\u80cc\u5305\u7684\u601d\u8def&#xff0c;\u800c\u4e0d\u662f0\/1\u80cc\u5305\u3002<\/p>\n<hr \/>\n<h4>\u7b2c\u4e94\u6b65&#xff1a;0\/1\u80cc\u5305\u4e0e\u5b8c\u5168\u80cc\u5305\u5bf9\u6bd4<\/h4>\n<table>\n<tr>\u80cc\u5305\u7c7b\u578b\u7269\u54c1\u4f7f\u7528\u6b21\u6570\u4e00\u7ef4DP\u5bb9\u91cf\u65b9\u5411<\/tr>\n<tbody>\n<tr>\n<td>0\/1\u80cc\u5305<\/td>\n<td>\u6bcf\u4ef6\u6700\u591a\u4e00\u6b21<\/td>\n<td>\u4ece\u5927\u5230\u5c0f<\/td>\n<\/tr>\n<tr>\n<td>\u5b8c\u5168\u80cc\u5305<\/td>\n<td>\u6bcf\u4ef6\u53ef\u4ee5\u591a\u6b21<\/td>\n<td>\u4ece\u5c0f\u5230\u5927<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<p>\u8bb0\u5fc6\u53e3\u8bc0&#xff1a;<\/p>\n<p>0\/1\u80cc\u5305&#xff0c;\u53ea\u80fd\u62ff\u4e00\u6b21&#xff0c;\u5bb9\u91cf\u5012\u7740\u8d70&#xff1b;\u5b8c\u5168\u80cc\u5305&#xff0c;\u53ef\u4ee5\u62ff\u591a\u6b21&#xff0c;\u5bb9\u91cf\u6b63\u7740\u8d70\u3002<\/p>\n<hr \/>\n<h3 style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004172523-6ac28c0319ac5.png\" \/><\/h3>\n<hr \/>\n<h3>\u7b2c8\u9898&#xff1a;\u90bb\u63a5\u8868\u904d\u5386\u67d0\u4e2a\u9876\u70b9\u7684\u6240\u6709\u90bb\u8fb9&#xff0c;\u65f6\u95f4\u4e0e\u56fe\u4e2d\u9876\u70b9\u6570\u6210\u6b63\u6bd4<\/h3>\n<p>\u274c\ufe0f\u9519\u8bef<\/p>\n<p>\u8fd9\u9053\u9898\u8003\u67e5\u56fe\u7684\u5b58\u50a8\u65b9\u5f0f&#xff0c;\u662f\u56fe\u8bba\u4e2d\u4e00\u4e2a\u5f88\u5bb9\u6613\u6df7\u6dc6\u7684\u77e5\u8bc6\u70b9\u3002<\/p>\n<hr \/>\n<h4>\u7b2c\u4e00\u6b65&#xff1a;\u4ec0\u4e48\u662f\u90bb\u63a5\u8868&#xff1f;<\/h4>\n<p>\u5047\u8bbe\u6709\u8fd9\u6837\u4e00\u5f20\u56fe&#xff1a;<\/p>\n<p>    1<br \/>\n   \/ \\\\<br \/>\n  2   3<br \/>\n   \\\\ \/<br \/>\n    4<\/p>\n<p>\u6211\u4eec\u53ef\u4ee5\u7528\u90bb\u63a5\u8868\u8bb0\u5f55\u6bcf\u4e2a\u9876\u70b9\u6709\u54ea\u4e9b\u90bb\u5c45\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<table>\n<tr>\u9876\u70b9\u90bb\u63a5\u70b9<\/tr>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>2&#xff0c;3<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>1&#xff0c;4<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>1&#xff0c;4<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>2&#xff0c;3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u90bb\u63a5\u8868\u5c31\u50cf\u4e00\u672c\u901a\u8baf\u5f55&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u627e\u5230\u67d0\u4e2a\u4eba\u3002<\/p>\n<\/li>\n<li>\n<p>\u67e5\u770b\u4ed6\u7684\u8054\u7cfb\u4eba\u3002<\/p>\n<\/li>\n<li>\n<p>\u4e0d\u9700\u8981\u628a\u6240\u6709\u4eba\u7684\u8054\u7cfb\u4eba\u5168\u90e8\u68c0\u67e5\u4e00\u904d\u3002<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<h4>\u7b2c\u4e8c\u6b65&#xff1a;\u904d\u5386\u67d0\u4e2a\u9876\u70b9\u7684\u90bb\u8fb9\u9700\u8981\u591a\u5c11\u65f6\u95f4&#xff1f;<\/h4>\n<p>\u5047\u8bbe\u6211\u4eec\u8981\u904d\u5386\u9876\u70b91\u7684\u6240\u6709\u90bb\u8fb9\u3002<\/p>\n<p>\u9876\u70b91\u53ea\u6709\u4e24\u4e2a\u90bb\u5c45&#xff1a;<\/p>\n<p>1 \u2192 2<br \/>\n1 \u2192 3<\/p>\n<p>\u53ea\u9700\u8981\u8bbf\u95ee\u8fd9\u4e24\u4e2a\u90bb\u63a5\u70b9\u3002<\/p>\n<p>\u5982\u679c\u4e00\u4e2a\u9876\u70b9\u67093\u6761\u90bb\u8fb9&#xff0c;\u90a3\u4e48\u5c31\u9700\u8981\u904d\u53863\u6761\u90bb\u8fb9\u3002<\/p>\n<p>\u6240\u4ee5&#xff0c;\u904d\u5386\u9876\u70b9 u\u00a0\u7684\u90bb\u63a5\u8868&#xff0c;\u65f6\u95f4\u590d\u6742\u5ea6\u662f&#xff1a;<\/p>\n<p><img decoding=\"async\" alt=\"\\\\boxed{O(deg(u))}\" class=\"mathcode\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004172523-6ac28c032d7d7.png\" \/><\/p>\n<p>\u5176\u4e2d&#xff1a;<\/p>\n<p>deg(u)<\/p>\n<p>\u8868\u793a\u9876\u70b9 u \u7684\u5ea6\u6570&#xff08;\u6709\u5411\u56fe\u4e2d\u8981\u6839\u636e\u5177\u4f53\u904d\u5386\u7684\u662f\u5165\u8fb9\u8fd8\u662f\u51fa\u8fb9\u6765\u7406\u89e3&#xff09;\u3002<\/p>\n<hr \/>\n<h4>\u7b2c\u4e09\u6b65&#xff1a;\u90a3\u4ec0\u4e48\u65f6\u5019\u662f O(n)&#xff1f;<\/h4>\n<p>\u5047\u8bbe\u56fe\u6709 n \u4e2a\u9876\u70b9\u3002<\/p>\n<p>\u5982\u679c\u67d0\u4e2a\u9876\u70b9\u8fde\u63a5\u4e86\u6240\u6709\u5176\u4ed6\u9876\u70b9&#xff0c;\u90a3\u4e48\u5b83\u7684\u90bb\u8fb9\u6570\u91cf\u6700\u591a\u53ef\u4ee5\u8fbe\u5230 n\u22121 \u3002<\/p>\n<p>\u8fd9\u65f6\u904d\u5386\u5b83\u7684\u90bb\u8fb9\u624d\u662f&#xff1a;<\/p>\n<p>O(n)\u00a0<\/p>\n<p>\u4f46\u662f&#xff0c;\u5e76\u4e0d\u662f\u6240\u6709\u9876\u70b9\u90fd\u8fde\u63a5\u4e86\u8fd9\u4e48\u591a\u70b9\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>1 \u2192 2<\/p>\n<p>3 \u2192 4<\/p>\n<p>5 \u2192 6<\/p>\n<p>\u56fe\u4e2d\u67096\u4e2a\u9876\u70b9&#xff0c;\u4f46\u6bcf\u4e2a\u9876\u70b9\u6700\u591a\u53ea\u67091\u6761\u51fa\u8fb9\u3002<\/p>\n<p>\u904d\u5386\u67d0\u4e2a\u9876\u70b9\u7684\u90bb\u8fb9&#xff0c;\u53ea\u9700\u8981\u5e38\u6570\u7ea7\u522b\u7684\u65f6\u95f4\u3002<\/p>\n<hr \/>\n<h4>\u7b2c\u56db\u6b65&#xff1a;\u8bb0\u4f4f\u4e09\u79cd\u5e38\u89c1\u590d\u6742\u5ea6<\/h4>\n<table>\n<tr>\u64cd\u4f5c\u90bb\u63a5\u8868\u7684\u65f6\u95f4\u590d\u6742\u5ea6<\/tr>\n<tbody>\n<tr>\n<td>\u904d\u5386\u9876\u70b9u\u7684\u6240\u6709\u90bb\u8fb9<\/td>\n<td>O(deg(u))<\/td>\n<\/tr>\n<tr>\n<td>\u904d\u5386\u6240\u6709\u9876\u70b9\u7684\u90bb\u8fb9<\/td>\n<td>O(n&#043;m&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u67e5\u627e\u4e24\u4e2a\u6307\u5b9a\u9876\u70b9\u4e4b\u95f4\u662f\u5426\u6709\u8fb9<\/td>\n<td>\u4e00\u822c\u9700\u8981\u904d\u5386\u90bb\u63a5\u8868&#xff0c;\u6700\u574f\u53ef\u8fbe O(deg(u))<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd9\u91cc&#xff1a;<\/p>\n<ul>\n<li>\n<p>n &#xff1a;\u9876\u70b9\u6570\u91cf\u3002<\/p>\n<\/li>\n<li>\n<p>m &#xff1a;\u8fb9\u7684\u6570\u91cf\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u56e0\u6b64&#xff0c;\u9898\u76ee\u8bf4\u904d\u5386\u67d0\u4e2a\u9876\u70b9\u7684\u6240\u6709\u90bb\u8fb9&#xff0c;\u65f6\u95f4\u4e0e\u9876\u70b9\u603b\u6570\u6210\u6b63\u6bd4&#xff0c;\u5e76\u4e0d\u603b\u662f\u6210\u7acb\u3002<\/p>\n<p>\u672c\u9898\u7ed3\u8bba&#xff1a;\u9519\u8bef\u274c\ufe0f\u3002<\/p>\n<hr \/>\n<p>\u8bb0\u5fc6\u53e3\u8bc0&#xff1a;<\/p>\n<p>\u90bb\u63a5\u8868&#xff0c;\u627e\u90bb\u5c45&#xff1b;\u904d\u5386\u591a\u5c11\u6761\u8fb9&#xff0c;\u5c31\u770b\u8fd9\u4e2a\u70b9\u6709\u591a\u5c11\u90bb\u8fb9\u3002<\/p>\n<hr \/>\n<h3 style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004172523-6ac28c0332a69.png\" \/><\/h3>\n<hr \/>\n<h3>\u7b2c9\u9898&#xff1a;\u5b8c\u5168\u4e8c\u53c9\u6811\u7684\u7236\u7ed3\u70b9\u7f16\u53f7<\/h3>\n<p>\u2705\ufe0f\u6b63\u786e<\/p>\n<p>\u9898\u76ee&#xff1a;<\/p>\n<p>\u5728\u6309\u5c42\u5e8f\u4ece1\u5f00\u59cb\u5bf9\u7ed3\u70b9\u7f16\u53f7\u7684\u5b8c\u5168\u4e8c\u53c9\u6811\u4e2d&#xff0c;\u7f16\u53f7\u4e3a i (i &gt;1)\u00a0\u7684\u7ed3\u70b9\u7684\u7236\u7ed3\u70b9\u7f16\u53f7\u4e3a&#xff1a;<\/p>\n<p>\u230ai\u200b \/ 2\u230b\u00a0<\/p>\n<hr \/>\n<h4>\u7b2c\u4e00\u6b65&#xff1a;\u4ec0\u4e48\u662f\u5b8c\u5168\u4e8c\u53c9\u6811&#xff1f;<\/h4>\n<p>\u5b8c\u5168\u4e8c\u53c9\u6811\u5c31\u662f&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u9664\u4e86\u6700\u540e\u4e00\u5c42&#xff0c;\u5176\u4ed6\u5c42\u90fd\u5fc5\u987b\u586b\u6ee1\u3002<\/p>\n<\/li>\n<li>\n<p>\u6700\u540e\u4e00\u5c42\u7684\u7ed3\u70b9\u4ece\u5de6\u5411\u53f3\u8fde\u7eed\u6392\u5217\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"Binary tree array representation - Learning JavaScript Data Structures and Algorithms - Third Edition [Book]\" height=\"712\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004172523-6ac28c0345b27.jpg\" width=\"1970\" \/><\/p>\n<hr \/>\n<h4>\u7b2c\u4e8c\u6b65&#xff1a;\u7ed9\u7ed3\u70b9\u7f16\u53f7<\/h4>\n<p>\u6309\u7167\u4ece\u4e0a\u5230\u4e0b\u3001\u4ece\u5de6\u5230\u53f3\u7684\u987a\u5e8f\u7f16\u53f7&#xff1a;<\/p>\n<p>             1<br \/>\n           \/   \\\\<br \/>\n          2     3<br \/>\n         \/ \\\\   \/ \\\\<br \/>\n        4   5 6   7<\/p>\n<p>\u89c2\u5bdf\u4e00\u4e0b&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u7ed3\u70b91\u662f\u6839\u7ed3\u70b9\u3002<\/p>\n<\/li>\n<li>\n<p>\u7ed3\u70b92\u548c3\u7684\u7236\u7ed3\u70b9\u662f1\u3002<\/p>\n<\/li>\n<li>\n<p>\u7ed3\u70b94\u548c5\u7684\u7236\u7ed3\u70b9\u662f2\u3002<\/p>\n<\/li>\n<li>\n<p>\u7ed3\u70b96\u548c7\u7684\u7236\u7ed3\u70b9\u662f3\u3002<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<p>\u6211\u4eec\u53d1\u73b0&#xff1a;<\/p>\n<p>\u7ed3\u70b9\u7f16\u53f7    \u7236\u7ed3\u70b9\u7f16\u53f7<\/p>\n<p>2           1<br \/>\n3           1<br \/>\n4           2<br \/>\n5           2<br \/>\n6           3<br \/>\n7           3<\/p>\n<hr \/>\n<h4>\u7b2c\u4e09\u6b65&#xff1a;\u627e\u89c4\u5f8b<\/h4>\n<p>\u7ed3\u70b92&#xff1a;<\/p>\n<p>2\/2 &#061; 1<\/p>\n<p>\u7ed3\u70b93&#xff1a;<\/p>\n<p>3\/2 &#061;1.5<\/p>\n<p>\u6574\u6570\u9664\u6cd5\u7ed3\u679c\u4e3a1\u3002<\/p>\n<p>\u7ed3\u70b94&#xff1a;<\/p>\n<p>4\/2 &#061; 2<\/p>\n<p>\u7ed3\u70b95&#xff1a;<\/p>\n<p>5\/2 &#061; 2.5<\/p>\n<p>\u6574\u6570\u9664\u6cd5\u7ed3\u679c\u4e3a2\u3002<\/p>\n<p>\u7ed3\u70b96&#xff1a;<\/p>\n<p>6\/2 &#061; 3<\/p>\n<p>\u7ed3\u70b97&#xff1a;<\/p>\n<p>7\/2 &#061; 3.5<\/p>\n<p>\u6574\u6570\u9664\u6cd5\u7ed3\u679c\u4e3a3\u3002<\/p>\n<p>\u6240\u4ee5&#xff1a;<\/p>\n<p>\u7236\u7ed3\u70b9\u7f16\u53f7 &#061; i \/ 2<\/p>\n<p>\u5728C&#043;&#043;\u4e2d&#xff0c;\u4e24\u4e2a\u6574\u6570\u76f8\u9664\u4f1a\u81ea\u52a8\u820d\u53bb\u5c0f\u6570\u90e8\u5206&#xff0c;\u56e0\u6b64\u53ef\u4ee5\u76f4\u63a5\u5199&#xff1a;<\/p>\n<p>C&#043;&#043;<\/p>\n<p>int fa &#061; i \/ 2;<\/p>\n<hr \/>\n<h4>\u7b2c\u56db\u6b65&#xff1a;\u518d\u8bb0\u4f4f\u4e24\u4e2a\u91cd\u8981\u516c\u5f0f<\/h4>\n<p>\u5982\u679c\u4e00\u4e2a\u7ed3\u70b9\u7684\u7f16\u53f7\u662f iii&#xff0c;\u90a3\u4e48&#xff1a;<\/p>\n<table>\n<tr>\u7ed3\u70b9\u7f16\u53f7\u516c\u5f0f<\/tr>\n<tbody>\n<tr>\n<td>\u7236\u7ed3\u70b9<\/td>\n<td>i \/ 2<\/td>\n<\/tr>\n<tr>\n<td>\u5de6\u5b69\u5b50<\/td>\n<td>2 * i<\/td>\n<\/tr>\n<tr>\n<td>\u53f3\u5b69\u5b50<\/td>\n<td>2* i &#043; 1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>C&#043;&#043;<\/p>\n<p>int fa &#061; i \/ 2;<br \/>\nint left &#061; 2 * i;<br \/>\nint right &#061; 2 * i &#043; 1;<\/p>\n<p>\u6ce8\u610f&#xff1a;\u8fd9\u4e9b\u516c\u5f0f\u9002\u7528\u4e8e\u4ece1\u5f00\u59cb\u7f16\u53f7\u7684\u5b8c\u5168\u4e8c\u53c9\u6811\u6570\u7ec4\u8868\u793a\u3002<\/p>\n<hr \/>\n<p>\u8bb0\u5fc6\u53e3\u8bc0&#xff1a;<\/p>\n<p>\u7236\u4eb2\u9664\u4ee52&#xff0c;\u5de6\u5b69\u5b50\u4e58\u4ee52&#xff0c;\u53f3\u5b69\u5b50\u4e58\u4ee52\u518d\u52a01\u3002<\/p>\n<hr \/>\n<h3 style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004172523-6ac28c03a4556.png\" \/><\/h3>\n<hr \/>\n<h3>\u7b2c10\u9898&#xff1a;\u6570\u7ec4\u540d arr \u548c &amp;arr[0] \u603b\u662f\u7b49\u4ef7<\/h3>\n<p>\u9519\u8bef<\/p>\n<p>\u8fd9\u9053\u9898\u8003\u67e5\u6570\u7ec4\u548c\u6307\u9488\u7684\u5173\u7cfb&#xff0c;\u662fC&#043;&#043;\u4e2d\u975e\u5e38\u5bb9\u6613\u51fa\u9519\u7684\u5730\u65b9\u3002<\/p>\n<hr \/>\n<h4>\u7b2c\u4e00\u6b65&#xff1a;\u5148\u770b\u4ee3\u7801<\/h4>\n<p>C&#043;&#043;<\/p>\n<p>int arr[10];<\/p>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u5b9a\u4e49\u4e86\u4e00\u4e2a\u6570\u7ec4&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u6570\u7ec4\u540d\u79f0&#xff1a;arr<\/p>\n<\/li>\n<li>\n<p>\u6570\u7ec4\u957f\u5ea6&#xff1a;10<\/p>\n<\/li>\n<li>\n<p>\u6bcf\u4e2a\u5143\u7d20\u7c7b\u578b&#xff1a;int<\/p>\n<\/li>\n<\/ul>\n<p>\u6570\u7ec4\u5143\u7d20\u5206\u522b\u662f&#xff1a;<\/p>\n<p>arr[0]<br \/>\narr[1]<br \/>\narr[2]<br \/>\narr[3]<br \/>\n&#8230;<br \/>\narr[9]<\/p>\n<hr \/>\n<h4>\u7b2c\u4e8c\u6b65&#xff1a;\u4ec0\u4e48\u662f &amp;arr[0] &#xff1f;<\/h4>\n<p>arr[0] \u8868\u793a\u6570\u7ec4\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u3002<\/p>\n<p>&amp;arr[0] \u8868\u793a\u7b2c\u4e00\u4e2a\u5143\u7d20\u7684\u5730\u5740\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>C&#043;&#043;<\/p>\n<p>int arr[5] &#061; {10, 20, 30, 40, 50};<\/p>\n<p>cout &lt;&lt; &amp;arr[0] &lt;&lt; endl;<\/p>\n<p>\u8fd9\u4f1a\u8f93\u51fa\u7b2c\u4e00\u4e2a\u5143\u7d20\u7684\u5185\u5b58\u5730\u5740\u3002<\/p>\n<hr \/>\n<h4>\u7b2c\u4e09\u6b65&#xff1a;\u6570\u7ec4\u540d arr \u53c8\u662f\u4ec0\u4e48&#xff1f;<\/h4>\n<p>\u5728\u5927\u591a\u6570\u8868\u8fbe\u5f0f\u4e2d&#xff0c;\u6570\u7ec4\u540d arr \u4f1a\u81ea\u52a8\u8f6c\u6362\u4e3a\u6307\u5411\u7b2c\u4e00\u4e2a\u5143\u7d20\u7684\u6307\u9488\u3002<\/p>\n<p>\u6240\u4ee5&#xff1a;<\/p>\n<p>C&#043;&#043;<\/p>\n<p>arr<\/p>\n<p>\u548c&#xff1a;<\/p>\n<p>C&#043;&#043;<\/p>\n<p>&amp;arr[0]<\/p>\n<p>\u5728\u5927\u591a\u6570\u666e\u901a\u8868\u8fbe\u5f0f\u4e2d&#xff0c;\u786e\u5b9e\u6307\u5411\u540c\u4e00\u4e2a\u4f4d\u7f6e\u3002<\/p>\n<hr \/>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>C&#043;&#043;<\/p>\n<p>int arr[5] &#061; {10, 20, 30, 40, 50};<\/p>\n<p>cout &lt;&lt; *arr &lt;&lt; endl;<br \/>\ncout &lt;&lt; *(&amp;arr[0]) &lt;&lt; endl;<\/p>\n<p>\u4e24\u884c\u8f93\u51fa\u90fd\u662f&#xff1a;<\/p>\n<p>10<br \/>\n10<\/p>\n<p>\u90a3\u4e48\u4e3a\u4ec0\u4e48\u672c\u9898\u8fd8\u662f\u9519\u7684&#xff1f;<\/p>\n<p>\u5173\u952e\u5c31\u5728\u4e8e\u9898\u76ee\u8bf4\u7684\u662f&#xff1a;<\/p>\n<p>\u603b\u662f\u7b49\u4ef7\u3002<\/p>\n<hr \/>\n<h4>\u7b2c\u56db\u6b65&#xff1a;\u6700\u91cd\u8981\u7684\u9677\u9631\u2014\u2014sizeof<\/h4>\n<p>\u770b\u4e0b\u9762\u7684\u7a0b\u5e8f&#xff1a;<\/p>\n<p>C&#043;&#043;<\/p>\n<p>#include &lt;iostream&gt;<br \/>\nusing namespace std;<\/p>\n<p>int main() {<br \/>\n    int arr[10];<\/p>\n<p>    cout &lt;&lt; sizeof(arr) &lt;&lt; endl;<br \/>\n    cout &lt;&lt; sizeof(&amp;arr[0]) &lt;&lt; endl;<\/p>\n<p>    return 0;<br \/>\n}<\/p>\n<p>\u5047\u8bbe\u4e00\u4e2a int \u53604\u4e2a\u5b57\u8282&#xff0c;\u4e00\u4e2a\u6307\u9488\u53608\u4e2a\u5b57\u8282\u3002<\/p>\n<p>\u90a3\u4e48&#xff1a;<\/p>\n<p>C&#043;&#043;<\/p>\n<p>sizeof(arr)<\/p>\n<p>\u8ba1\u7b97\u7684\u662f\u6574\u4e2a\u6570\u7ec4\u5360\u7528\u7684\u5185\u5b58&#xff1a;<\/p>\n<p>10\u00d74 &#061; 40\u00a0<\/p>\n<p>\u800c&#xff1a;<\/p>\n<p>C&#043;&#043;<\/p>\n<p>sizeof(&amp;arr[0])<\/p>\n<p>\u8ba1\u7b97\u7684\u662f\u4e00\u4e2a\u6307\u9488\u5360\u7528\u7684\u5185\u5b58&#xff1a;<\/p>\n<p>8<\/p>\n<p>\u4e8e\u662f\u8f93\u51fa&#xff1a;<\/p>\n<p>40<br \/>\n8<\/p>\n<p>\u4e24\u8005\u663e\u7136\u4e0d\u76f8\u7b49&#xff01;<\/p>\n<hr \/>\n<p>\u4e24\u4e2a\u8868\u8fbe\u5f0f\u7684\u533a\u522b<\/p>\n<p>sizeof(arr):<\/p>\n<p>\u8ba1\u7b97\u6574\u4e2a\u6570\u7ec4\u7684\u5927\u5c0f&#xff1a;10\u4e2aint\u5143\u7d20\u3002<\/p>\n<p>sizeof(&amp;arr00)<\/p>\n<p>\u53ea\u8ba1\u7b97\u4e00\u4e2a\u5730\u5740\u6240\u5360\u7684\u5927\u5c0f\u3002<\/p>\n<p>\u672c\u9898\u7ed3\u8bba&#xff1a;\u9519\u8bef \u274c\ufe0f\u3002<\/p>\n<hr \/>\n<p>\u8bb0\u5fc6\u53e3\u8bc0&#xff1a;<\/p>\n<p>\u6570\u7ec4\u540d\u901a\u5e38\u4ee3\u8868\u9996\u5143\u7d20\u5730\u5740&#xff0c;\u4f46\u6570\u7ec4\u540d\u4e0d\u7b49\u4e8e\u666e\u901a\u6307\u9488\u53d8\u91cf&#xff1b;\u7279\u522b\u6ce8\u610f sizeof \u548c &amp;arr&#xff01;<\/p>\n<hr \/>\n<h2>\u4e8c\u300110\u9053\u5224\u65ad\u9898\u7684\u6838\u5fc3\u77e5\u8bc6\u70b9\u603b\u7ed3<\/h2>\n<p>\u8fd910\u9053\u9898\u6d89\u53ca\u7684\u77e5\u8bc6\u70b9&#xff0c;\u6211\u4eec\u53ef\u4ee5\u628a\u5b83\u4eec\u6574\u7406\u6210\u4e00\u5f20\u590d\u4e60\u8868\u3002<\/p>\n<table>\n<tr>\u77e5\u8bc6\u70b9\u5fc5\u987b\u638c\u63e1\u7684\u7ed3\u8bba<\/tr>\n<tbody>\n<tr>\n<td>\u6570\u5b66\u51fd\u6570<\/td>\n<td>exp(0)&#061;1.0&#xff0c;\u8fd4\u56de\u7c7b\u578b\u4e3a double<\/td>\n<\/tr>\n<tr>\n<td>\u54c8\u5e0c\u8868<\/td>\n<td>\u5f00\u653e\u5b9a\u5740\u6cd5\u5220\u9664\u5143\u7d20&#xff0c;\u4e0d\u80fd\u968f\u610f\u7f6e\u7a7a<\/td>\n<\/tr>\n<tr>\n<td>\u54c8\u592b\u66fc\u6811<\/td>\n<td>\u6bcf\u6b21\u5408\u5e76\u4e24\u4e2a\u6700\u5c0f\u6743\u503c&#xff0c;\u76ee\u6807\u662fWPL\u6700\u5c0f<\/td>\n<\/tr>\n<tr>\n<td>\u6709\u5411\u56fe<\/td>\n<td>\u5165\u5ea6\u603b\u548c\u7b49\u4e8e\u51fa\u5ea6\u603b\u548c<\/td>\n<\/tr>\n<tr>\n<td>BFS<\/td>\n<td>\u901a\u5e38\u4f7f\u7528\u961f\u5217<\/td>\n<\/tr>\n<tr>\n<td>DFS<\/td>\n<td>\u901a\u5e38\u4f7f\u7528\u9012\u5f52\u6216\u6808<\/td>\n<\/tr>\n<tr>\n<td>\u5feb\u901f\u6392\u5e8f<\/td>\n<td>\u5e73\u5747 O(nlog\u2061n)&#xff0c;\u6700\u574f O(n^2)<\/td>\n<\/tr>\n<tr>\n<td>0\/1\u80cc\u5305<\/td>\n<td>\u4e00\u7ef4DP\u5bb9\u91cf\u4ece\u5927\u5230\u5c0f\u679a\u4e3e<\/td>\n<\/tr>\n<tr>\n<td>\u90bb\u63a5\u8868<\/td>\n<td>\u904d\u5386\u9876\u70b9u\u7684\u90bb\u8fb9&#xff0c;\u590d\u6742\u5ea6 O(deg(u))<\/td>\n<\/tr>\n<tr>\n<td>\u5b8c\u5168\u4e8c\u53c9\u6811<\/td>\n<td>\u7236\u4eb2\u7f16\u53f7 i\/2 &#xff0c;\u5de6\u5b69\u5b50 2i&#xff0c;\u53f3\u5b69\u5b50 2i&#043;1<\/td>\n<\/tr>\n<tr>\n<td>\u6570\u7ec4\u4e0e\u6307\u9488<\/td>\n<td>\u6570\u7ec4\u540d\u4e0e\u9996\u5143\u7d20\u5730\u5740\u5728\u5f88\u591a\u8868\u8fbe\u5f0f\u4e2d\u76f8\u540c&#xff0c;\u4f46\u5e76\u975e\u603b\u662f\u7b49\u4ef7<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h2>\u4e09\u3001\u7ed9\u5927\u5bb6\u7279\u522b\u63d0\u9192<\/h2>\n<p>\u6211\u5efa\u8bae\u5b66\u751f\u4eec\u91cd\u70b9\u8bb0\u4f4f\u4e0b\u9762\u4e94\u7ec4\u5bb9\u6613\u6df7\u6dc6\u7684\u77e5\u8bc6\u70b9\u3002<\/p>\n<p>\u7b2c\u4e00\u7ec4&#xff1a;BFS\u548cDFS<\/p>\n<ul>\n<li>\n<p>BFS&#xff1a;\u961f\u5217&#xff0c;\u5148\u8fdb\u5148\u51fa\u3002<\/p>\n<\/li>\n<li>\n<p>DFS&#xff1a;\u6808&#xff0c;\u540e\u8fdb\u5148\u51fa&#xff1b;\u9012\u5f52\u4e5f\u53ef\u4ee5\u5b9e\u73b0\u3002<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<p>\u7b2c\u4e8c\u7ec4&#xff1a;\u5feb\u901f\u6392\u5e8f<\/p>\n<ul>\n<li>\n<p>\u5e73\u5747\u590d\u6742\u5ea6&#xff1a;O(nlog\u2061n)\u3002<\/p>\n<\/li>\n<li>\n<p>\u6700\u574f\u590d\u6742\u5ea6&#xff1a;O(n^2)\u3002<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<p>\u7b2c\u4e09\u7ec4&#xff1a;0\/1\u80cc\u5305\u548c\u5b8c\u5168\u80cc\u5305<\/p>\n<ul>\n<li>\n<p>0\/1\u80cc\u5305&#xff1a;\u4ece\u5927\u5230\u5c0f\u3002<\/p>\n<\/li>\n<li>\n<p>\u5b8c\u5168\u80cc\u5305&#xff1a;\u4ece\u5c0f\u5230\u5927\u3002<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<p>\u7b2c\u56db\u7ec4&#xff1a;\u56fe\u7684\u90bb\u63a5\u8868<\/p>\n<ul>\n<li>\n<p>\u904d\u5386\u67d0\u4e2a\u70b9\u7684\u90bb\u8fb9&#xff1a;O(deg(u))\u3002<\/p>\n<\/li>\n<li>\n<p>\u904d\u5386\u6574\u5f20\u56fe&#xff1a;O(n&#043;m)\u3002<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<p>\u7b2c\u4e94\u7ec4&#xff1a;\u6570\u7ec4\u4e0e\u6307\u9488<\/p>\n<ul>\n<li>\n<p>arr&#xff1a;\u5927\u591a\u6570\u8868\u8fbe\u5f0f\u4e2d\u4f1a\u8f6c\u6362\u4e3a\u9996\u5143\u7d20\u5730\u5740\u3002<\/p>\n<\/li>\n<li>\n<p>&amp;arr[0]&#xff1a;\u9996\u5143\u7d20\u7684\u5730\u5740\u3002<\/p>\n<\/li>\n<li>\n<p>sizeof(arr)&#xff1a;\u6574\u4e2a\u6570\u7ec4\u7684\u5927\u5c0f\u3002<\/p>\n<\/li>\n<li>\n<p>sizeof(&amp;arr[0])&#xff1a;\u6307\u9488\u7684\u5927\u5c0f\u3002<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<h2>\u56db\u3001\u8bfe\u5802\u5c0f\u6d4b&#xff1a;\u770b\u770b\u5b66\u751f\u662f\u5426\u771f\u6b63\u638c\u63e1\u4e86<\/h2>\n<p>\u8bfe\u540e\u7ec3\u4e60\u3002<\/p>\n<p>\u4e03\u7ea7\u5224\u65ad\u9898\u77e5\u8bc6\u5de9\u56fa<\/p>\n<p>\u5355\u9009\u9898<\/p>\n<p>\u7b2c1\u9898&#xff1a;\u5f00\u653e\u5b9a\u5740\u6cd5\u4e2d&#xff0c;\u5220\u9664\u4e00\u4e2a\u5143\u7d20\u65f6&#xff0c;\u901a\u5e38\u5e94\u8be5\u600e\u4e48\u505a&#xff1f;<\/p>\n<p>A. \u76f4\u63a5\u5c06\u4f4d\u7f6e\u6e05\u7a7a<\/p>\n<p>B. \u6807\u8bb0\u4e3a\u5df2\u5220\u9664\u72b6\u6001<\/p>\n<p>C. \u628a\u6574\u4e2a\u54c8\u5e0c\u8868\u6e05\u7a7a<\/p>\n<p>D. \u628a\u6240\u6709\u5143\u7d20\u4e58\u4ee52<\/p>\n<hr \/>\n<p>\u7b2c2\u9898&#xff1a;\u5feb\u901f\u6392\u5e8f\u7684\u6700\u574f\u65f6\u95f4\u590d\u6742\u5ea6\u662f&#xff1f;<\/p>\n<p>A. O(1)<\/p>\n<p>B. O(log n)<\/p>\n<p>C. O(n log n)<\/p>\n<p>D. O(n\u00b2)<\/p>\n<hr \/>\n<p>\u7b2c3\u9898&#xff1a;\u4f7f\u7528\u4e00\u7ef4\u6570\u7ec4\u89e3\u51b30\/1\u80cc\u5305\u65f6&#xff0c;\u5bb9\u91cf\u5e94\u8be5\u600e\u6837\u679a\u4e3e&#xff1f;<\/p>\n<p>A. \u4ece\u5c0f\u5230\u5927<\/p>\n<p>B. \u4ece\u5927\u5230\u5c0f<\/p>\n<p>C. \u968f\u673a\u679a\u4e3e<\/p>\n<p>D. \u53ea\u679a\u4e3e\u5947\u6570<\/p>\n<hr \/>\n<p>\u7b2c4\u9898&#xff1a;\u90bb\u63a5\u8868\u4e2d&#xff0c;\u904d\u5386\u9876\u70b9u\u7684\u6240\u6709\u90bb\u8fb9&#xff0c;\u65f6\u95f4\u590d\u6742\u5ea6\u901a\u5e38\u662f&#xff1f;<\/p>\n<p>A. O(1)<\/p>\n<p>B. O(deg(u))<\/p>\n<p>C. O(n\u00b2)<\/p>\n<p>D. O(2^n)<\/p>\n<hr \/>\n<p>\u7b2c5\u9898&#xff1a;\u4ece1\u5f00\u59cb\u7f16\u53f7\u7684\u5b8c\u5168\u4e8c\u53c9\u6811\u4e2d&#xff0c;\u7f16\u53f7\u4e3a13\u7684\u7ed3\u70b9&#xff0c;\u5176\u7236\u7ed3\u70b9\u7f16\u53f7\u662f\u591a\u5c11&#xff1f;<\/p>\n<p>A. 5<\/p>\n<p>B. 6<\/p>\n<p>C. 7<\/p>\n<p>D. 8<\/p>\n<hr \/>\n<p>\u4e03\u7ea7\u5224\u65ad\u9898\u771f\u6b63\u8003\u67e5\u7684\u4e0d\u662f\u6b7b\u8bb0\u786c\u80cc&#xff0c;\u800c\u662f\u80fd\u4e0d\u80fd\u53d1\u73b0\u4e00\u53e5\u8bdd\u91cc\u7684\u5173\u952e\u6761\u4ef6\u3002<\/p>\n<p>\u7279\u522b\u662f\u770b\u5230\u4e0b\u9762\u8fd9\u4e9b\u8bcd\u65f6&#xff0c;\u4e00\u5b9a\u8981\u505c\u4e0b\u6765\u60f3\u4e00\u60f3&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u201c\u603b\u662f\u201d<\/p>\n<\/li>\n<li>\n<p>\u201c\u4e00\u5b9a\u201d<\/p>\n<\/li>\n<li>\n<p>\u201c\u6240\u6709\u201d<\/p>\n<\/li>\n<li>\n<p>\u201c\u5e73\u5747\u201d<\/p>\n<\/li>\n<li>\n<p>\u201c\u6700\u574f\u201d<\/p>\n<\/li>\n<li>\n<p>\u201c\u53ea\u80fd\u201d<\/p>\n<\/li>\n<li>\n<p>\u201c\u5fc5\u987b\u201d<\/p>\n<\/li>\n<\/ul>\n<p>\u8fd9\u4e9b\u8bcd\u5f80\u5f80\u5c31\u662f\u5224\u65ad\u9898\u7684\u9677\u9631\u6240\u5728\u3002<\/p>\n<p>\u505a\u5224\u65ad\u9898&#xff0c;\u4e0d\u8981\u53ea\u770b\u5b83\u8bb2\u7684\u77e5\u8bc6\u70b9\u5bf9\u4e0d\u5bf9&#xff0c;\u8fd8\u8981\u770b\u5b83\u8bf4\u5f97\u662f\u4e0d\u662f\u592a\u7edd\u5bf9\u3002 \u8fd9\u4e5f\u662f\u4ece\u521d\u7ea7C&#043;&#043;\u5b66\u4e60\u8d70\u5411\u7b97\u6cd5\u601d\u7ef4\u7684\u91cd\u8981\u4e00\u6b65\u3002<\/p>\n<hr \/>\n","protected":false},"excerpt":{"rendered":"<p>\u7b2c1\u9898&#xff1a;exp(0) \u7684\u7ed3\u679c\u6b63\u786e\u9898\u76ee&#xff1a;\u4f7f\u7528 cmath \u6216 math.h \u4e2d\u7684\u51fd\u6570&#xff0c;\u8868\u8fbe\u5f0f exp(0) \u7684\u7ed3\u679c\u503c\u4e3a 1.0&#xff0c;\u4e14\u7c7b\u578b\u4e3a double\u3002\u7b2c\u4e00\u6b65&#xff1a;\u8ba4\u8bc6 exp \u51fd\u6570exp(x) \u662fC\u6570\u5b66\u5e93\u4e2d\u7684\u4e00\u4e2a\u51fd\u6570&#xff0c;\u5b83\u8868\u793a&#xff1a;exp(x)\u00a0  e^x\u8fd9\u91cc\u7684 e \u662f\u4e00\u4e2a\u6570\u5b66\u5e38\u6570&#xff0c;\u7ea6\u7b49\u4e8e&#xff1a;e \u2248 2.71828\u56e0\u6b64&#xff1a;exp(0)  e^0 1\u6240\u4ee5<\/p>\n","protected":false},"author":2,"featured_media":112826,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[10494,10493,55,5181],"topic":[],"class_list":["post-112844","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-c","tag-10493","tag-gesp"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>GESP2026\u5e749\u6708\u8ba4\u8bc1C++\u4e03\u7ea7( \u7b2c\u4e8c\u90e8\u5206\u5224\u65ad\u9898\uff081~10\u9898\uff09\u7cbe\u8bb2 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/112844.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"GESP2026\u5e749\u6708\u8ba4\u8bc1C++\u4e03\u7ea7( \u7b2c\u4e8c\u90e8\u5206\u5224\u65ad\u9898\uff081~10\u9898\uff09\u7cbe\u8bb2 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u7b2c1\u9898&#xff1a;exp(0) \u7684\u7ed3\u679c\u6b63\u786e\u9898\u76ee&#xff1a;\u4f7f\u7528 cmath \u6216 math.h \u4e2d\u7684\u51fd\u6570&#xff0c;\u8868\u8fbe\u5f0f exp(0) \u7684\u7ed3\u679c\u503c\u4e3a 1.0&#xff0c;\u4e14\u7c7b\u578b\u4e3a double\u3002\u7b2c\u4e00\u6b65&#xff1a;\u8ba4\u8bc6 exp \u51fd\u6570exp(x) \u662fC\u6570\u5b66\u5e93\u4e2d\u7684\u4e00\u4e2a\u51fd\u6570&#xff0c;\u5b83\u8868\u793a&#xff1a;exp(x)\u00a0 e^x\u8fd9\u91cc\u7684 e \u662f\u4e00\u4e2a\u6570\u5b66\u5e38\u6570&#xff0c;\u7ea6\u7b49\u4e8e&#xff1a;e \u2248 2.71828\u56e0\u6b64&#xff1a;exp(0) e^0 1\u6240\u4ee5\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/112844.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-04T17:25:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004172520-6ac28c00611cb.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/112844.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/112844.html\",\"name\":\"GESP2026\u5e749\u6708\u8ba4\u8bc1C++\u4e03\u7ea7( \u7b2c\u4e8c\u90e8\u5206\u5224\u65ad\u9898\uff081~10\u9898\uff09\u7cbe\u8bb2 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-04T17:25:24+00:00\",\"dateModified\":\"2026-10-04T17:25:24+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/112844.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/112844.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/112844.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"GESP2026\u5e749\u6708\u8ba4\u8bc1C++\u4e03\u7ea7( \u7b2c\u4e8c\u90e8\u5206\u5224\u65ad\u9898\uff081~10\u9898\uff09\u7cbe\u8bb2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"GESP2026\u5e749\u6708\u8ba4\u8bc1C++\u4e03\u7ea7( \u7b2c\u4e8c\u90e8\u5206\u5224\u65ad\u9898\uff081~10\u9898\uff09\u7cbe\u8bb2 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/112844.html","og_locale":"zh_CN","og_type":"article","og_title":"GESP2026\u5e749\u6708\u8ba4\u8bc1C++\u4e03\u7ea7( \u7b2c\u4e8c\u90e8\u5206\u5224\u65ad\u9898\uff081~10\u9898\uff09\u7cbe\u8bb2 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u7b2c1\u9898&#xff1a;exp(0) \u7684\u7ed3\u679c\u6b63\u786e\u9898\u76ee&#xff1a;\u4f7f\u7528 cmath \u6216 math.h \u4e2d\u7684\u51fd\u6570&#xff0c;\u8868\u8fbe\u5f0f exp(0) \u7684\u7ed3\u679c\u503c\u4e3a 1.0&#xff0c;\u4e14\u7c7b\u578b\u4e3a double\u3002\u7b2c\u4e00\u6b65&#xff1a;\u8ba4\u8bc6 exp \u51fd\u6570exp(x) \u662fC\u6570\u5b66\u5e93\u4e2d\u7684\u4e00\u4e2a\u51fd\u6570&#xff0c;\u5b83\u8868\u793a&#xff1a;exp(x)\u00a0 e^x\u8fd9\u91cc\u7684 e \u662f\u4e00\u4e2a\u6570\u5b66\u5e38\u6570&#xff0c;\u7ea6\u7b49\u4e8e&#xff1a;e \u2248 2.71828\u56e0\u6b64&#xff1a;exp(0) e^0 1\u6240\u4ee5","og_url":"https:\/\/www.wsisp.com\/helps\/112844.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-04T17:25:24+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004172520-6ac28c00611cb.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/112844.html","url":"https:\/\/www.wsisp.com\/helps\/112844.html","name":"GESP2026\u5e749\u6708\u8ba4\u8bc1C++\u4e03\u7ea7( \u7b2c\u4e8c\u90e8\u5206\u5224\u65ad\u9898\uff081~10\u9898\uff09\u7cbe\u8bb2 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-04T17:25:24+00:00","dateModified":"2026-10-04T17:25:24+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/112844.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/112844.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/112844.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"GESP2026\u5e749\u6708\u8ba4\u8bc1C++\u4e03\u7ea7( \u7b2c\u4e8c\u90e8\u5206\u5224\u65ad\u9898\uff081~10\u9898\uff09\u7cbe\u8bb2"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/112844","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=112844"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/112844\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/112826"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=112844"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=112844"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=112844"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=112844"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}