{"id":74913,"date":"2026-02-10T22:41:33","date_gmt":"2026-02-10T14:41:33","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/74913.html"},"modified":"2026-02-10T22:41:33","modified_gmt":"2026-02-10T14:41:33","slug":"2025%e7%ba%a7%e5%a4%a7%e4%b8%80acm%e8%ae%ad%e7%bb%83%ef%bc%9a%e4%ba%8c%e8%bf%9b%e5%88%b6%e6%9e%9a%e4%b8%be","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/74913.html","title":{"rendered":"2025\u7ea7\u5927\u4e00ACM\u8bad\u7ec3\uff1a\u4e8c\u8fdb\u5236\u679a\u4e3e"},"content":{"rendered":"<h3 style=\"background-color:transparent\">\u524d\u8a00<\/h3>\n<p>\u5bf9\u4e8e\u4e00\u4e2a\u5305\u542bn\u4e2a\u5143\u7d20\u7684\u96c6\u5408&#xff0c;\u6bcf\u4e2a\u5143\u7d20\u6709 \u201c\u9009\u201d \u548c \u201c\u4e0d\u9009\u201d \u4e24\u79cd\u72b6\u6001&#xff0c;\u603b\u5171\u67092^n\u79cd\u5b50\u96c6&#xff08;\u5305\u62ec\u7a7a\u96c6&#xff09;\u3002\u7528\u4e00\u4e2an\u4f4d\u7684\u4e8c\u8fdb\u5236\u6570\u6765\u8868\u793a\u4e00\u79cd\u9009\u53d6\u72b6\u6001&#xff1a;<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4e8c\u8fdb\u5236\u4f4d\u4e3a1&#xff1a;\u8868\u793a\u5bf9\u5e94\u4f4d\u7f6e\u7684\u5143\u7d20\u88ab\u9009\u4e2d&#xff1b;<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4e8c\u8fdb\u5236\u4f4d\u4e3a0&#xff1a;\u8868\u793a\u5bf9\u5e94\u4f4d\u7f6e\u7684\u5143\u7d20\u672a\u88ab\u9009\u4e2d\u3002<\/p>\n<p>\u5f02\u6216\u8fd0\u7b97&#xff1a;<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 X ^ X &#061; 0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0X ^ 0 &#061; X<\/p>\n<h3>\u6797\u5927OJ 643&#xff1a;teacher Li<\/h3>\n<p>\u6ce8\u610f&#xff1a;\u6570\u7ec4a,b\u5b9a\u4e49\u6210\u5168\u5c40\u53d8\u91cf&#xff0c;\u8fd9\u6837\u5b58\u5728\u9759\u6001\u533a&#xff0c;\u4f1a\u81ea\u52a8\u521d\u59cb\u5316\u4e3a0&#xff0c;\u6709\u52a9\u4e8e\u6211\u4eec\u7684\u5f02\u6216\u8fd0\u7b97<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"3274\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260210144112-698b4388a1440.png\" width=\"1889\" \/><\/p>\n<p>#include &lt;bits\/stdc&#043;&#043;.h&gt;<br \/>\nusing namespace std;<\/p>\n<p>int n,cnt;<br \/>\nchar a[35], b[35];<\/p>\n<p>int main()<br \/>\n{<br \/>\n    while(~scanf(&#034;%d&#034;,&amp;n))<br \/>\n    {<br \/>\n        cnt&#043;&#043;;<br \/>\n        scanf(&#034;%s&#034;,a);<br \/>\n        for(int i &#061; 1; i &lt;&#061; 2 * n &#8211; 2; i&#043;&#043;)<br \/>\n        {<br \/>\n            scanf(&#034;%s&#034;, b);<br \/>\n            int len &#061; strlen(b);<br \/>\n            for(int j &#061; 0; j &lt; len; j&#043;&#043;)<br \/>\n            {<br \/>\n                a[j] &#061; a[j] ^ b[j];<br \/>\n            }<br \/>\n        }<br \/>\n        printf(&#034;Scenario #%d\\\\n&#034;,cnt);<br \/>\n        printf(&#034;%s\\\\n\\\\n&#034;,a);<br \/>\n    }<br \/>\n    return 0;<br \/>\n} <\/p>\n<h3>\u6797\u5927OJ 1172&#xff1a;Find different<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"3152\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260210144115-698b438b8f3f2.png\" width=\"1893\" \/><\/p>\n<p>#include &lt;bits\/stdc&#043;&#043;.h&gt;<br \/>\nusing namespace std;<\/p>\n<p>int n,x;<br \/>\nint main()<br \/>\n{<br \/>\n    while(~scanf(&#034;%d&#034;,&amp;n))<br \/>\n    {<br \/>\n        int ans &#061; 0;<br \/>\n        while(n&#8211;)<br \/>\n        {<br \/>\n            scanf(&#034;%d&#034;,&amp;x);<br \/>\n            ans &#061; ans ^ x;<br \/>\n        }<br \/>\n        printf(&#034;%d\\\\n&#034;,ans);<br \/>\n    }<br \/>\n    return 0;<br \/>\n} <\/p>\n<h3 style=\"background-color:transparent\">\u6797\u5927OJ 1205&#xff1a;\u548c\u4e3aK&#8211;\u4e8c\u8fdb\u5236\u679a\u4e3e<\/h3>\n<p>\u4e24\u4e2a\u4e8c\u8fdb\u5236\u6570\u8fdb\u884c\u4e0e\u8fd0\u7b97&#xff0c;\u53ea\u6709\u5bf9\u5e94\u4f4d\u7f6e\u90fd\u662f1\u624d\u662f1&#xff0c;\u6709\u4e00\u4e2a\u4f4d\u7f6e\u662f0\u5c31\u662f0&#xff0c;\u4f8b\u5982&#xff1a;010&amp;110 &#061; 1&#xff0c;010&amp;101 &#061; 0<\/p>\n<p>\u679a\u4e3e\u6240\u6709\u5b50\u96c6&#xff1a;<span style=\"background-color:#d4e9d5\">i &lt; (1&lt;&lt;N)<\/span><\/p>\n<p>1&lt;&lt;N \u7b49\u4ef7\u4e8e 2^N&#xff0c;\u8868\u793a\u957f\u5ea6\u4e3a N \u7684\u6570\u7ec4\u5171\u6709 2^N \u4e2a\u5b50\u96c6&#xff08;\u5305\u62ec\u7a7a\u96c6&#xff09;\u3002<\/p>\n<p>\u5224\u65ad\u662f\u5426\u9009\u4e2d\u5143\u7d20&#xff1a;<span style=\"background-color:#d4e9d5\">i &amp; (1&lt;&lt;j)<\/span><\/p>\n<p>1&lt;&lt;j&#xff1a;\u751f\u6210\u4e00\u4e2a \u201c\u53ea\u6709\u7b2c j \u4f4d\u662f 1&#xff0c;\u5176\u4f59\u4f4d\u90fd\u662f 0\u201d \u7684\u6570&#xff08;\u6bd4\u5982 j&#061;0\u21921&#061;001&#xff0c;j&#061;1\u21922&#061;010&#xff0c;j&#061;2\u21924&#061;100&#xff09;&#xff1b;<\/p>\n<p>i &amp; (1&lt;&lt;j)&#xff1a;\u6309\u4f4d\u4e0e\u8fd0\u7b97&#xff0c;\u53ea\u6709\u5f53 i \u7684\u7b2c j \u4f4d\u662f 1 \u65f6&#xff0c;\u7ed3\u679c\u624d \u2260 0&#xff08;\u8868\u793a\u9009\u4e2d&#xff09;&#xff0c;\u5426\u5219 &#061; 0&#xff08;\u4e0d\u9009&#xff09;\u3002<\/p>\n<p>\u8fd9\u5757\u6bd4\u8f83\u96be\u7406\u89e3&#xff0c;\u6211\u4eec\u4ee5n&#061;3&#xff0c;k&#061;5\u4e3e\u4f8b&#xff0c;\u5047\u8bbe\u90a3\u4e09\u4e2a\u6570\u662f[1&#xff0c;2&#xff0c;3]&#xff0c;\u6211\u4eec\u770b\u4e0b\u9762\u8fd9\u5f20\u8868&#xff0c;\u8fd9\u65f6\u00a0 \u00a0 \u00a0i &lt; (1&lt;&lt;3)\u5373 i&lt;8, \u5171\u6709\u516b\u4e2a\u5b50\u96c6\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"650\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260210144118-698b438e5f90d.png\" width=\"1046\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"2632\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260210144118-698b438eaa897.png\" width=\"1887\" \/><\/p>\n<p>#include &lt;bits\/stdc&#043;&#043;.h&gt;<br \/>\nusing namespace std;<\/p>\n<p>int a[25];<\/p>\n<p>int main()<br \/>\n{<br \/>\n    ios::sync_with_stdio(false);<br \/>\n   int N, K;<br \/>\n   while(cin&gt;&gt;N&gt;&gt;K)<br \/>\n   {<br \/>\n       for(int i &#061; 0; i &lt; N; i&#043;&#043;)<br \/>\n        cin&gt;&gt;a[i];<\/p>\n<p>       int f &#061; 1;<\/p>\n<p>       for(int i &#061; 0; i &lt;(1&lt;&lt;N); i&#043;&#043;)\/\/\u904d\u5386\u6bcf\u4e00\u79cd\u5b50\u96c6\u7684\u60c5\u51b5<br \/>\n       {<br \/>\n           int sum &#061; 0;<br \/>\n           for(int j &#061; 0; j &lt; N; j&#043;&#043;)<br \/>\n           {<br \/>\n               if(i &amp; (1&lt;&lt;j))\/\/\u8868\u793a\u5f531\u7684\u7b2cj\u4f4d\u662f1\u65f6&#xff0c;\u624d\u9009\u4e2d<br \/>\n               {<br \/>\n                   sum &#043;&#061; a[j];<br \/>\n               }<br \/>\n           }<br \/>\n           if(sum &#061;&#061;K)<br \/>\n           {<br \/>\n               cout&lt;&lt;&#034;Yes&#034;&lt;&lt;endl;<br \/>\n               f &#061; 0;<br \/>\n               break;<br \/>\n           }<br \/>\n       }<br \/>\n       if(f &#061;&#061; 1)<br \/>\n        cout&lt;&lt;&#034;No&#034;&lt;&lt;endl;<br \/>\n   }<br \/>\n    return 0;<br \/>\n}<\/p>\n<h3>\u6797\u5927OJ 1505&#xff1a;\u9648\u8001\u5e08\u52a0\u6cb9-\u4e8c\u8fdb\u5236\u679a\u4e3e<\/h3>\n<p>\u8bf4\u660e&#xff1a;\u7b2c\u4e00\u5c42\u5faa\u73af\u5faa\u73af\u76f8\u5f53\u4e8e\u679a\u4e3e\u51fa\u6240\u6709\u7684\u60c5\u51b5&#xff0c;\u7b2c\u4e8c\u5c42\u5faa\u73af\u662f\u770b\u8fd9\u4e2a01\u4e32\u4e0a\u7684\u5404\u4f4d\u662f0\u8fd8\u662f1&#xff0c;\u5982\u679c\u662f0\u7684\u8bdd\u5c31\u5f53\u4f5c\u52a0\u6cb9\u7ad9\u8ba1\u6570&#xff0c;\u5982\u679c\u4e3a1\u5c31\u628a\u5f53\u4f5c\u8def\u53e3\u8ba1\u6570&#xff0c;\u8ba1\u6570\u7ed3\u675f\u4ee5\u540e\u6216\u8005\u6cb9\u4e0d\u591f\u4e86\u7684\u8bdd\u5c31\u9000\u51fa\u5224\u65ad&#xff0c;\u5982\u679c\u52a0\u6cb9\u7ad9\u6570\u91cf\u548c\u8def\u53e3\u6570\u91cf\u6ee1\u8db3\u8981\u6c42\u4e86\u800c\u4e14\u6cb9\u6070\u597d\u7528\u5b8c\u7684\u8bdd&#xff0c;\u8fd9\u6b64\u679a\u4e3e\u5230\u7684\u8fd9\u79cd\u60c5\u51b5\u5c31\u662f\u7b26\u5408\u8981\u6c42\u7684\u628a\u8ba1\u7b97\u8fdb\u6765\u3002<\/p>\n<p>\u628a\u548c\u4e3ak\u90a3\u9053\u9898\u7406\u89e3\u660e\u767d\u4e4b\u540e\u5728\u505a\u8fd9\u4e2a\u5c31\u4f1a\u597d\u5f88\u591a\u54e6<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"2167\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260210144122-698b4392bcf06.png\" width=\"1875\" \/><\/p>\n<p>#include &lt;bits\/stdc&#043;&#043;.h&gt;<br \/>\nusing namespace std;<\/p>\n<p>int main()<br \/>\n{<br \/>\n    ios::sync_with_stdio(false);<br \/>\n    int T;<br \/>\n    while(cin&gt;&gt;T)<br \/>\n    {<br \/>\n        int cnt &#061; 0;<br \/>\n        for(int i &#061; 0; i&lt;(1&lt;&lt;15); i&#043;&#043;)\/\/\u76f8\u5f53\u4e8e\u4e00\u4e2a15\u4f4d\u768401\u4e32&#xff0c;\u5982\u679c\u662f0&#xff0c;\u8868\u793a\u9047\u5230\u52a0\u6cb9\u7ad9&#xff0c;\u662f1\u8868\u793a\u9047\u5230\u5341\u5b57\u8def\u53e3<br \/>\n        {<br \/>\n            int cross_road&#061;0, gap_station&#061;0, tmp &#061; T;<br \/>\n            for(int j &#061; 0; j&lt;15; j&#043;&#043;)<br \/>\n            {<br \/>\n                if(i &amp; (1&lt;&lt;j) &amp;&amp; tmp &gt;0)<br \/>\n                {<br \/>\n                    tmp -&#061;1;<br \/>\n                    cross_road&#043;&#043;;<br \/>\n                }<br \/>\n                else if(tmp &gt; 0)<br \/>\n                {<br \/>\n                    tmp *&#061; 2;<br \/>\n                    gap_station&#043;&#043;;<br \/>\n                }<br \/>\n            }<br \/>\n            if(gap_station&#061;&#061;5 &amp;&amp; cross_road &#061;&#061; 10 &amp;&amp;tmp &#061;&#061; 0)<br \/>\n                cnt&#043;&#043;;<br \/>\n        }<br \/>\n        cout&lt;&lt;cnt&lt;&lt;endl;<br \/>\n    }<br \/>\n    return 0;<br \/>\n} <\/p>\n<h3 style=\"background-color:transparent\">\u6797\u5927OJ 1518&#xff1a;\u7eb8\u724c\u6e38\u620f-\u4e8c\u8fdb\u5236-\u641c\u7d22<\/h3>\n<p>\u8fd9\u9053\u9898\u548c\u548c\u4e3aK&#8211;\u4e8c\u8fdb\u5236\u679a\u4e3e\u5f88\u76f8\u4f3c&#xff01;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"2041\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260210144125-698b4395633f3.png\" width=\"1891\" \/><\/p>\n<p>#include &lt;bits\/stdc&#043;&#043;.h&gt;<br \/>\nusing namespace std;<\/p>\n<p>int main()<br \/>\n{<br \/>\n    ios::sync_with_stdio(false);<br \/>\n    int n, p;<br \/>\n    int a[25];<br \/>\n    while(cin&gt;&gt;n&gt;&gt;p)<br \/>\n    {<br \/>\n        int cnt &#061; 0;<br \/>\n        for(int i &#061; 0; i &lt;n; i&#043;&#043;)<br \/>\n            cin&gt;&gt;a[i];<br \/>\n        for(int i &#061; 1; i &lt; (1&lt;&lt;n); i&#043;&#043;)\/\/\u4e0d\u9700\u8981\u7edf\u8ba1\u7a7a\u96c6<br \/>\n        {<br \/>\n            int ans&#061;0;<br \/>\n            for(int j &#061; 0; j &lt; n; j&#043;&#043;)<br \/>\n            {<br \/>\n                if(i &amp; (1&lt;&lt;j))<br \/>\n                {<br \/>\n                    ans&#043;&#061;a[j];<br \/>\n                }<br \/>\n            }<br \/>\n            if(ans &#061;&#061; p)<br \/>\n                cnt&#043;&#043;;<br \/>\n        }<br \/>\n        cout&lt;&lt;cnt&lt;&lt;endl;<br \/>\n    }<br \/>\n    return 0;<br \/>\n}<\/p>\n<h3 style=\"background-color:transparent\">\u6797\u5927OJ 1641&#xff1a;\u6743\u5229\u6307\u6570<\/h3>\n<ul><\/ul>\n<p>\u6838\u5fc3\u903b\u8f91&#xff1a;\u4e8c\u8fdb\u5236\u679a\u4e3e\u6240\u6709\u5b50\u96c6 \u2192 \u7b5b\u9009\u83b7\u80dc\u8054\u76df \u2192 \u904d\u5386\u8054\u76df\u627e\u5173\u952e\u52a0\u5165\u8005 \u2192 \u7edf\u8ba1\u6743\u5229\u6307\u6570&#xff1b;<\/p>\n<p>\u5173\u952e\u6280\u5de7&#xff1a;\u7528\u4f4d\u8fd0\u7b97\u5224\u65ad\u6210\u5458\u662f\u5426\u5728\u8054\u76df\u4e2d&#xff0c;\u7528 \u201c\u79fb\u9664\u540e\u7968\u6570\u548c\u201d \u5224\u65ad\u662f\u5426\u4e3a\u5173\u952e\u52a0\u5165\u8005&#xff1b;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"2886\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260210144126-698b4396d8022.png\" width=\"2275\" \/><\/p>\n<p>#include &lt;bits\/stdc&#043;&#043;.h&gt;<br \/>\nusing namespace std;<\/p>\n<p>int main()<br \/>\n{<br \/>\n    ios::sync_with_stdio(false);<br \/>\n    int T;<br \/>\n    cin&gt;&gt;T;<br \/>\n    while(T&#8211;)<br \/>\n    {<br \/>\n        int n;<br \/>\n        cin&gt;&gt;n;<br \/>\n        vector&lt;int&gt; votes(n); \/\/\u5b58\u50a8\u6bcf\u4e2a\u5c0f\u56e2\u4f53\u7684\u7968\u6570<br \/>\n        int total &#061; 0;<br \/>\n        for(int i &#061; 0; i &lt; n; i&#043;&#043;)<br \/>\n        {<br \/>\n            cin&gt;&gt;votes[i];<br \/>\n            total &#043;&#061; votes[i];<br \/>\n        }<\/p>\n<p>        double half_votes &#061; total \/ 2.0;<br \/>\n        vector&lt;int&gt; power(n, 0);<\/p>\n<p>        \/\/\u7a7a\u96c6\u4e00\u5b9a\u4e0d\u662f\u83b7\u80dc\u8054\u76df<br \/>\n        for(int i &#061; 1; i &lt; (1&lt;&lt;n); i&#043;&#043;){<br \/>\n            int sum &#061; 0;<br \/>\n            for(int j &#061; 0; j &lt; n; j&#043;&#043;)<br \/>\n            {<br \/>\n                if(i &amp; (1&lt;&lt;j)){sum &#043;&#061;votes[j];}<br \/>\n            }<\/p>\n<p>            \/\/\u5224\u65ad\u662f\u5426\u4e3a\u83b7\u80dc\u8054\u76df<br \/>\n            if(sum &lt;&#061; half_votes)<br \/>\n                continue;<\/p>\n<p>            for(int j &#061; 0; j &lt; n; j&#043;&#043;){<br \/>\n                if(i &amp; (1&lt;&lt;j))<br \/>\n                {<br \/>\n                    int sum_without_j &#061; sum &#8211; votes[j];<br \/>\n                    if(sum_without_j &lt;&#061; half_votes)<br \/>\n                        power[j]&#043;&#043;;<br \/>\n                }<br \/>\n            }<br \/>\n        }<br \/>\n        for(int i &#061; 0; i &lt; n; i&#043;&#043;){<br \/>\n            cout&lt;&lt;power[i];<br \/>\n            if(i !&#061; n-1)<br \/>\n                cout&lt;&lt;&#034; &#034;;<br \/>\n        }<br \/>\n        cout&lt;&lt;endl;<br \/>\n    }<br \/>\n    return 0;<br \/>\n}<\/p>\n<h3>\u6797\u5927OJ 1285&#xff1a;\u8da3\u5473\u89e3\u9898<\/h3>\n<p><span style=\"background-color:#38d8f0\">\u7ec4\u5408\u6982\u7387 &#061; \u505a\u5bf9\u9898\u7684 AC \u6982\u7387\u4e58\u79ef \u00d7 \u505a\u9519\u9898\u7684 WA \u6982\u7387\u4e58\u79ef<\/span><\/p>\n<p>\u4e00\u4e2a\u7ec4\u5408\u662f \u201c\u591a\u4e2a\u72ec\u7acb\u4e8b\u4ef6&#xff08;\u6bcf\u9898\u7684\u5bf9 \/ \u9519&#xff09;\u540c\u65f6\u53d1\u751f\u201d&#xff0c;\u56e0\u6b64\u6982\u7387\u662f\u5404\u4e8b\u4ef6\u6982\u7387\u7684\u4e58\u79ef\u6240\u6709 \u201c\u505a\u5bf9\u9898\u6570 &#061; cnt&#061;x\u201d \u7684\u7ec4\u5408\u6982\u7387\u76f8\u52a0&#xff0c;\u5c31\u662f\u6700\u7ec8\u7b54\u6848\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1626\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260210144131-698b439b67520.png\" width=\"1881\" \/><\/p>\n<p>#include &lt;bits\/stdc&#043;&#043;.h&gt;<br \/>\nusing namespace std;<\/p>\n<p>int main() {<br \/>\n    ios::sync_with_stdio(false);<br \/>\n    int T;<br \/>\n    cin &gt;&gt; T;<br \/>\n    while (T&#8211;) {<br \/>\n        int n, x;<br \/>\n        double a[15], b[15], c[15];<br \/>\n        double ac[15], wa[15];<br \/>\n        cin &gt;&gt; n;<\/p>\n<p>        for (int i &#061; 0; i &lt; n; i&#043;&#043;) cin &gt;&gt; a[i];<br \/>\n        for (int i &#061; 0; i &lt; n; i&#043;&#043;) cin &gt;&gt; b[i];<br \/>\n        for (int i &#061; 0; i &lt; n; i&#043;&#043;) cin &gt;&gt; c[i];<br \/>\n        cin &gt;&gt; x;<\/p>\n<p>        for (int i &#061; 0; i &lt; n; i&#043;&#043;) {<br \/>\n            wa[i] &#061; (1 &#8211; a[i]) * (1 &#8211; b[i]) * (1 &#8211; c[i]); \/\/ \u4e09\u4eba\u90fd\u505a\u9519\u7684\u6982\u7387<br \/>\n            ac[i] &#061; 1 &#8211; wa[i];<br \/>\n        }<\/p>\n<p>        double ans &#061; 0.0; \/\/ \u521d\u59cb\u5316\u7ed3\u679c\u4e3a0&#xff08;\u5173\u952e&#xff01;&#xff09;<br \/>\n        \/\/ \u679a\u4e3e\u6240\u6709\u505a\u9898\u72b6\u6001&#xff08;i\u7684\u4e8c\u8fdb\u5236\u4f4d\u8868\u793a\u6bcf\u9053\u9898\u662f\u5426AC&#xff09;<br \/>\n        for (int i &#061; 0; i &lt; (1 &lt;&lt; n); i&#043;&#043;) {<br \/>\n            int cnt &#061; 0;<br \/>\n            double p &#061; 1.0;<br \/>\n            for (int j &#061; 0; j &lt; n; j&#043;&#043;) {<br \/>\n                if (i &amp; (1 &lt;&lt; j)) { \/\/ \u7b2cj\u9898\u505a\u5bf9<br \/>\n                    p *&#061; ac[j];<br \/>\n                    cnt&#043;&#043;;<br \/>\n                } else { \/\/ \u7b2cj\u9898\u505a\u9519<br \/>\n                    p *&#061; wa[j];<br \/>\n                }<br \/>\n            }<br \/>\n            \/\/\u628a\u6bcf\u79cd\u7ec4\u5408\u7684\u6982\u7387\u52a0\u5728\u4e00\u8d77<br \/>\n            if (cnt &#061;&#061; x) {<br \/>\n                ans &#043;&#061; p;<br \/>\n            }<br \/>\n        }<\/p>\n<p>        printf(&#034;%.4lf\\\\n&#034;, ans);<br \/>\n    }<br \/>\n    return 0;<br \/>\n} <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00<br \/>\n\u5bf9\u4e8e\u4e00\u4e2a\u5305\u542bn\u4e2a\u5143\u7d20\u7684\u96c6\u5408&#xff0c;\u6bcf\u4e2a\u5143\u7d20\u6709 \u201c\u9009\u201d \u548c \u201c\u4e0d\u9009\u201d \u4e24\u79cd\u72b6\u6001&#xff0c;\u603b\u5171\u67092^n\u79cd\u5b50\u96c6&#xff08;\u5305\u62ec\u7a7a\u96c6&#xff09;\u3002\u7528\u4e00\u4e2an\u4f4d\u7684\u4e8c\u8fdb\u5236\u6570\u6765\u8868\u793a\u4e00\u79cd\u9009\u53d6\u72b6\u6001&#xff1a; \u4e8c\u8fdb\u5236\u4f4d\u4e3a1&#xff1a;\u8868\u793a\u5bf9\u5e94\u4f4d\u7f6e\u7684\u5143\u7d20\u88ab\u9009\u4e2d&#xff1b; \u4e8c\u8fdb\u5236\u4f4d\u4e3a0&#xff1a;\u8868\u793a\u5bf9\u5e94\u4f4d\u7f6e\u7684\u5143\u7d20\u672a\u88ab\u9009\u4e2d\u3002<br \/>\n\u5f02\u6216\u8fd0\u7b97&#xff1a; X ^ X  0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0X ^ 0  X<br \/>\n\u6797\u5927OJ 643&#xff1a;teacher <\/p>\n","protected":false},"author":2,"featured_media":74905,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[7373,7933,6985,55,174,427,729],"topic":[],"class_list":{"0":"post-74913","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","6":"hentry","7":"category-server","8":"tag-acm","9":"tag-7933","10":"tag-6985","11":"tag-c","13":"tag-427","14":"tag-729"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>2025\u7ea7\u5927\u4e00ACM\u8bad\u7ec3\uff1a\u4e8c\u8fdb\u5236\u679a\u4e3e - \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\/74913.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"2025\u7ea7\u5927\u4e00ACM\u8bad\u7ec3\uff1a\u4e8c\u8fdb\u5236\u679a\u4e3e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u524d\u8a00 \u5bf9\u4e8e\u4e00\u4e2a\u5305\u542bn\u4e2a\u5143\u7d20\u7684\u96c6\u5408&#xff0c;\u6bcf\u4e2a\u5143\u7d20\u6709 \u201c\u9009\u201d \u548c \u201c\u4e0d\u9009\u201d \u4e24\u79cd\u72b6\u6001&#xff0c;\u603b\u5171\u67092^n\u79cd\u5b50\u96c6&#xff08;\u5305\u62ec\u7a7a\u96c6&#xff09;\u3002\u7528\u4e00\u4e2an\u4f4d\u7684\u4e8c\u8fdb\u5236\u6570\u6765\u8868\u793a\u4e00\u79cd\u9009\u53d6\u72b6\u6001&#xff1a; \u4e8c\u8fdb\u5236\u4f4d\u4e3a1&#xff1a;\u8868\u793a\u5bf9\u5e94\u4f4d\u7f6e\u7684\u5143\u7d20\u88ab\u9009\u4e2d&#xff1b; \u4e8c\u8fdb\u5236\u4f4d\u4e3a0&#xff1a;\u8868\u793a\u5bf9\u5e94\u4f4d\u7f6e\u7684\u5143\u7d20\u672a\u88ab\u9009\u4e2d\u3002 \u5f02\u6216\u8fd0\u7b97&#xff1a; X ^ X 0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0X ^ 0 X \u6797\u5927OJ 643&#xff1a;teacher\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/74913.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-10T14:41:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260210144112-698b4388a1440.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=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/74913.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/74913.html\",\"name\":\"2025\u7ea7\u5927\u4e00ACM\u8bad\u7ec3\uff1a\u4e8c\u8fdb\u5236\u679a\u4e3e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-10T14:41:33+00:00\",\"dateModified\":\"2026-02-10T14:41:33+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/74913.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/74913.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/74913.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"2025\u7ea7\u5927\u4e00ACM\u8bad\u7ec3\uff1a\u4e8c\u8fdb\u5236\u679a\u4e3e\"}]},{\"@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":"2025\u7ea7\u5927\u4e00ACM\u8bad\u7ec3\uff1a\u4e8c\u8fdb\u5236\u679a\u4e3e - \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\/74913.html","og_locale":"zh_CN","og_type":"article","og_title":"2025\u7ea7\u5927\u4e00ACM\u8bad\u7ec3\uff1a\u4e8c\u8fdb\u5236\u679a\u4e3e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u524d\u8a00 \u5bf9\u4e8e\u4e00\u4e2a\u5305\u542bn\u4e2a\u5143\u7d20\u7684\u96c6\u5408&#xff0c;\u6bcf\u4e2a\u5143\u7d20\u6709 \u201c\u9009\u201d \u548c \u201c\u4e0d\u9009\u201d \u4e24\u79cd\u72b6\u6001&#xff0c;\u603b\u5171\u67092^n\u79cd\u5b50\u96c6&#xff08;\u5305\u62ec\u7a7a\u96c6&#xff09;\u3002\u7528\u4e00\u4e2an\u4f4d\u7684\u4e8c\u8fdb\u5236\u6570\u6765\u8868\u793a\u4e00\u79cd\u9009\u53d6\u72b6\u6001&#xff1a; \u4e8c\u8fdb\u5236\u4f4d\u4e3a1&#xff1a;\u8868\u793a\u5bf9\u5e94\u4f4d\u7f6e\u7684\u5143\u7d20\u88ab\u9009\u4e2d&#xff1b; \u4e8c\u8fdb\u5236\u4f4d\u4e3a0&#xff1a;\u8868\u793a\u5bf9\u5e94\u4f4d\u7f6e\u7684\u5143\u7d20\u672a\u88ab\u9009\u4e2d\u3002 \u5f02\u6216\u8fd0\u7b97&#xff1a; X ^ X 0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0X ^ 0 X \u6797\u5927OJ 643&#xff1a;teacher","og_url":"https:\/\/www.wsisp.com\/helps\/74913.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-10T14:41:33+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260210144112-698b4388a1440.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/74913.html","url":"https:\/\/www.wsisp.com\/helps\/74913.html","name":"2025\u7ea7\u5927\u4e00ACM\u8bad\u7ec3\uff1a\u4e8c\u8fdb\u5236\u679a\u4e3e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-10T14:41:33+00:00","dateModified":"2026-02-10T14:41:33+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/74913.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/74913.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/74913.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"2025\u7ea7\u5927\u4e00ACM\u8bad\u7ec3\uff1a\u4e8c\u8fdb\u5236\u679a\u4e3e"}]},{"@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\/74913","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=74913"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/74913\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/74905"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=74913"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=74913"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=74913"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=74913"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}