{"id":47,"date":"2009-12-12T00:18:00","date_gmt":"2009-12-11T16:18:00","guid":{"rendered":"http:\/\/localhost\/?p=47"},"modified":"2009-12-12T00:18:00","modified_gmt":"2009-12-11T16:18:00","slug":"sgu_377","status":"publish","type":"post","link":"https:\/\/www.shuizilong.com\/wjmzbmr\/?p=47","title":{"rendered":"sgu 377"},"content":{"rendered":"<p> N\u4e45\u6ca1\u505asgu\u4e86\u3002\u3002\u3002<br \/>\u8fd9\u9053\u9898\u610f\u601d\u662f\u8bf4\u7ed9\u4f60\u4e00\u4e2an*m\u7684\u68cb\u76d8\u6bcf\u4e2a\u6570\u6216\u4e3a1\u6216\u4e3a0\uff0c\u6bcf\u4e00\u4e2a2*2\u7684\u5b50\u77e9\u9635\u7684\u548c\u90fd\u662f2\u3002\u3002<br \/>\u6c42\u65b9\u6cd5\u6570\u3002\u3002<br \/>n\u548cm\u90a3\u4e48\u5927\u80af\u5b9a\u662f\u6709\u516c\u5f0f\u7684\u3002\u3002<br \/>\u5148\u662f\u5199\u4e86\u72b6\u538bDP\u7b97\u4e86\u4e00\u4e0b\u3002\u3002\u770b\u51fa\u516c\u5f0f\u662f2^m+2^n-2\u3002\u3002<br \/>\u6211\u662f\u8fd9\u4e48\u63a8\u5bfc\u7684\u3002\u3002<br \/>\u56e0\u4e3a\u7b2c\u4e00\u884c\u67092^m\u79cd\u653e\u6cd5\u3002\u3002\u5176\u4e2d\u9664\u4e86010101\u548c101010\u4e4b\u5916\u3002\u3002<br \/>\u7b2c\u4e00\u884c\u4e00\u786e\u5b9a\u5176\u4ed6\u884c\u4e5f\u90fd\u786e\u5b9a\u4e86\u3002\u3002\u4e8e\u662f\u5c31\u67092^m-2\u79cd\u3002\u3002<br \/>\u53c8\u5982\u679c\u7b2c\u4e00\u884c\u662f010101\u6216101010\u3002\u3002\u90a3\u4e48\u7b2c\u4e8c\u884c\u4e5f\u53ea\u80fd\u9009\u8fd9\u4e24\u79cd\u3002\u3002<br \/>\u6bcf\u4e00\u884c\u90fd\u6709\u4e24\u79cd\u9009\u62e9\u3002\u3002\u4e8e\u662f\u5c31\u662f2^n\u79cd\u3002\u3002<br \/>\u52a0\u4e00\u4e0b\u5c31\u662f\u7b54\u6848\u4e86\u3002\u3002\u3002<br \/>#include&lt;iostream&gt;<br \/>#include&lt;cstring&gt;<br \/>using namespace std;<br \/>const int maxl=1000;<br \/>struct bignum<br \/>{<br \/>int Q[maxl],last;<br \/>bignum()<br \/>{<br \/>memset(Q,0,sizeof(Q));last=0;<br \/>}<br \/>void set(int a)<br \/>{&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; <br \/>Q[last]=a;<br \/>}<br \/>int&amp; operator[](int v){return Q[v];}<br \/>bignum operator+(bignum&amp;x)<br \/>{<br \/>bignum ans;ans.last=max(last,x.last);int d=0;<br \/>for(int i=0;i&lt;=ans.last;i++)<br \/>{<br \/>d+=x[i]+Q[i];<br \/>ans[i]=d%10;<br \/>d\/=10;<br \/>}<br \/>if(d)ans[++ans.last]=d;<br \/>return ans;<br \/>}<br \/>void operator-=(int x)<br \/>{&#160;&#160;&#160; <br \/>for(int i=0;i&lt;=last;i++)<br \/>{<br \/>if(Q[i]&gt;=x) {Q[i]-=x;return;}<br \/>else{Q[i]=10+Q[i]-x;x=1;}<br \/>}<br \/>}<br \/>bignum operator*(int x)<br \/>{<br \/>int d=0;bignum ans;ans.last=last;<br \/>for(int i=0;i&lt;=ans.last;i++)<br \/>{<br \/>d+=Q[i]*x;<br \/>ans[i]=d%10;<br \/>d\/=10;<br \/>}<br \/>while(d)<br \/>{<br \/>ans[++ans.last]=d%10;<br \/>d\/=10;<br \/>}<br \/>return ans;<br \/>}<br \/>void operator=(const bignum&amp;x)<br \/>{<br \/>memmove(Q,x.Q,sizeof(Q));<br \/>last=x.last;<br \/>}<br \/>void print()<br \/>{<br \/>for(int i=last;i&gt;=0;i&#8211;)<br \/>cout&lt;&lt;Q[i];<br \/>}<br \/>}a,b;<br \/>int main()<br \/>{<br \/>int n,m;cin&gt;&gt;n&gt;&gt;m;<br \/>if(n&lt;m){int t=n;n=m;m=t;}<br \/>b.set(1);<br \/>for(int i=1;i&lt;=n;i++)<br \/>{<br \/>b=b*2;<br \/>if(i==m) a=b;<br \/>}<br \/>a=a+b;<br \/>a-=2;<br \/>a.print();cout&lt;&lt;endl;<br \/>} <\/p>\n","protected":false},"excerpt":{"rendered":"<p>N\u4e45\u6ca1\u505asgu\u4e86\u3002\u3002\u3002\u8fd9\u9053\u9898\u610f\u601d\u662f\u8bf4\u7ed9\u4f60\u4e00\u4e2an*m\u7684\u68cb\u76d8\u6bcf\u4e2a\u6570\u6216\u4e3a1\u6216\u4e3a0\uff0c\u6bcf\u4e00\u4e2a2*2\u7684\u5b50\u77e9\u9635\u7684\u548c\u90fd\u662f2\u3002\u3002\u6c42\u65b9\u6cd5\u6570\u3002\u3002n\u548cm\u90a3\u4e48\u5927\u80af\u5b9a\u662f\u6709\u516c\u5f0f\u7684\u3002\u3002\u5148\u662f\u5199\u4e86\u72b6\u538bDP\u7b97\u4e86\u4e00\u4e0b\u3002\u3002\u770b\u51fa\u516c\u5f0f\u662f2^m+2^n-2\u3002\u3002\u6211\u662f\u8fd9\u4e48\u63a8\u5bfc\u7684\u3002\u3002\u56e0\u4e3a\u7b2c\u4e00\u884c\u67092^m\u79cd\u653e\u6cd5\u3002\u3002\u5176\u4e2d\u9664\u4e86010101\u548c101010\u4e4b\u5916\u3002\u3002\u7b2c\u4e00\u884c\u4e00\u786e\u5b9a\u5176\u4ed6\u884c\u4e5f\u90fd\u786e\u5b9a\u4e86\u3002\u3002\u4e8e\u662f\u5c31\u67092^m-2\u79cd\u3002\u3002\u53c8\u5982\u679c\u7b2c\u4e00\u884c\u662f010101\u6216101010\u3002\u3002\u90a3\u4e48\u7b2c\u4e8c\u884c\u4e5f\u53ea\u80fd\u9009\u8fd9\u4e24\u79cd\u3002\u3002\u6bcf\u4e00\u884c\u90fd\u6709\u4e24\u79cd\u9009\u62e9\u3002\u3002\u4e8e\u662f\u5c31\u662f2^n\u79cd\u3002\u3002\u52a0\u4e00\u4e0b\u5c31\u662f\u7b54\u6848\u4e86\u3002\u3002\u3002#include&lt;iostream&gt;#include&lt;cstring&gt;using namespace std;const int maxl=1000;struct bignum{int Q[maxl],last;bignum(){memset(Q,0,sizeof(Q));last=0;}void set(int a){&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; Q[last]=a;}int&amp; operator[](int v){return Q[v];}bignum operator+(bignum&amp;x){bignum ans;ans.last=max(last,x.last);int d=0;for(int i=0;i&lt;=ans.last;i++){d+=x[i]+Q[i];ans[i]=d%10;d\/=10;}if(d)ans[++ans.last]=d;return ans;}void operator-=(int x){&#160;&#160;&#160; for(int i=0;i&lt;=last;i++){if(Q[i]&gt;=x) {Q[i]-=x;return;}else{Q[i]=10+Q[i]-x;x=1;}}}bignum operator*(int x){int d=0;bignum ans;ans.last=last;for(int i=0;i&lt;=ans.last;i++){d+=Q[i]*x;ans[i]=d%10;d\/=10;}while(d){ans[++ans.last]=d%10;d\/=10;}return ans;}void operator=(const bignum&amp;x){memmove(Q,x.Q,sizeof(Q));last=x.last;}void print(){for(int i=last;i&gt;=0;i&#8211;)cout&lt;&lt;Q[i];}}a,b;int main(){int n,m;cin&gt;&gt;n&gt;&gt;m;if(n&lt;m){int t=n;n=m;m=t;}b.set(1);for(int i=1;i&lt;=n;i++){b=b*2;if(i==m) a=b;}a=a+b;a-=2;a.print();cout&lt;&lt;endl;}<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=\/wp\/v2\/posts\/47"}],"collection":[{"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=47"}],"version-history":[{"count":0,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=\/wp\/v2\/posts\/47\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=47"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=47"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=47"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}