{"id":213,"date":"2010-04-04T14:20:00","date_gmt":"2010-04-04T06:20:00","guid":{"rendered":"http:\/\/localhost\/?p=213"},"modified":"2010-04-04T14:20:00","modified_gmt":"2010-04-04T06:20:00","slug":"topcoder_srm_466_div_2_1000","status":"publish","type":"post","link":"https:\/\/www.shuizilong.com\/wjmzbmr\/?p=213","title":{"rendered":"TopCoder SRM 466 DIV 2 1000"},"content":{"rendered":"<p> \u8fd9\u9053\u9898\u662f\u8bf4\u7ed9\u4f60\u4e00\u4e2a\u6700\u59278*8\u7684\u77e9\u9635\uff0c\u6bcf\u6b21\u4f60\u53ef\u4ee5\u4ea4\u6362\u4e24\u884c\u6216\u4e24\u5217\uff0c\u8ba9\u5b83\u7684\u884c\u4f18\u5148\u904d\u5386\u7684\u5b57\u5178\u5e8f\u6700\u5c0f\u3002\u3002<br \/>\u5b9e\u9645\u4e0a\u5f88\u7b80\u5355\uff0c\u524d\u5929\u6211\u94bb\u7814\u4e86\u697c\u6559\u4e3b\u7684\u90e8\u5206\u641c\u7d22\u7684\u8bba\u6587\uff0c\u8fd9\u9053\u9898\u76ee\u5b9e\u9645\u4e0a\u90e8\u5206\u641c\u7d22\u5c31\u53ef\u4ee5\u4e86\uff0c\u53ea\u8981\u5217\u7684\u6392\u5217\u987a\u5e8f\u786e\u5b9a\u4e86\uff0c\u884c\u53ea\u8981\u6392\u4e2a\u5e8f\u5c31\u53ef\u4ee5\u4e86\u3002\u3002<br \/>\u90a3\u4e48\u6548\u7387\u5c31\u662f(n!*n^2*logn)\u5bf9\u4ed8\u8fd9\u9898n=8\u8db3\u591f\u4e86\u3002\u3002<br \/>\u6655\u3002\u3002\u771f\u7684\u4e0d\u80fd\u518d\u641e\u7f16\u7a0b\u4e86\u3002\u3002\u8fd8\u67091\u4e2a\u661f\u671f\u5c31\u8981\u6570\u5b66\u7ade\u8d5b\u4e86\u5929\u554a\u3002\u3002\u795e\u554a\u3002\u4fdd\u4f51\u6211\u5427\u56e7\u3002\u3002<br \/>#include &lt;vector&gt;<br \/>#include &lt;list&gt;<br \/>#include &lt;map&gt;<br \/>#include &lt;set&gt;<br \/>#include &lt;deque&gt;<br \/>#include &lt;stack&gt;<br \/>#include &lt;bitset&gt;<br \/>#include &lt;algorithm&gt;<br \/>#include &lt;functional&gt;<br \/>#include &lt;numeric&gt;<br \/>#include &lt;utility&gt;<br \/>#include &lt;sstream&gt;<br \/>#include &lt;iostream&gt;<br \/>#include &lt;iomanip&gt;<br \/>#include &lt;cstdio&gt;<br \/>#include &lt;cmath&gt;<br \/>#include &lt;cstdlib&gt;<br \/>#include &lt;ctime&gt;<br \/>#define rep(i,n) for(int i=0;i&lt;n;i++)<br \/>#define pb push_back<br \/>#define tr(i,x) for(typeof(x.begin()) i=x.begin();i!=x.end();i++)<br \/>#define all(x) x.begin(),x.end()<br \/>const int inf=~0U&gt;&gt;1;<br \/>using namespace std;<br \/>typedef pair&lt;int,int&gt; ii;<br \/>typedef vector&lt;int&gt; vi;<br \/>typedef vi::iterator vit;<br \/>class MatrixGame {<br \/>public:<br \/> vector &lt;string&gt; getMinimal(vector &lt;string&gt;);<br \/>};<br \/>int n,m;<br \/>vector&lt;string&gt; tmp,M,ans;<br \/>bool used[10]={0};<br \/>void dfs(int p)<br \/>{<br \/> if(p==m)<br \/> {<br \/>  vector&lt;string&gt; t=tmp;<br \/>  sort(all(t));<br \/>  ans=min(ans,t);<br \/>  return;<br \/> }<br \/> rep(i,m)if(!used[i])<br \/> {<br \/>  used[i]=true;<br \/>  rep(j,n) tmp[j][p]=M[j][i];<br \/>  dfs(p+1);<br \/>  used[i]=false;<br \/> }<br \/>}<br \/>vector &lt;string&gt; MatrixGame::getMinimal(vector &lt;string&gt; _M) {<br \/> ans=M=_M;<br \/> n=M.size();m=M[0].size();<br \/> tmp.resize(n);rep(i,n)tmp[i].resize(m);dfs(0);<br \/> return ans;<br \/>}<\/p>\n<p>\/\/Powered by [KawigiEdit] 2.0! <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u9053\u9898\u662f\u8bf4\u7ed9\u4f60\u4e00\u4e2a\u6700\u59278*8\u7684\u77e9\u9635\uff0c\u6bcf\u6b21\u4f60\u53ef\u4ee5\u4ea4\u6362\u4e24\u884c\u6216\u4e24\u5217\uff0c\u8ba9\u5b83\u7684\u884c\u4f18\u5148\u904d\u5386\u7684\u5b57\u5178\u5e8f\u6700\u5c0f\u3002\u3002\u5b9e\u9645\u4e0a\u5f88\u7b80\u5355\uff0c\u524d\u5929\u6211\u94bb\u7814\u4e86\u697c\u6559\u4e3b\u7684\u90e8\u5206\u641c\u7d22\u7684\u8bba\u6587\uff0c\u8fd9\u9053\u9898\u76ee\u5b9e\u9645\u4e0a\u90e8\u5206\u641c\u7d22\u5c31\u53ef\u4ee5\u4e86\uff0c\u53ea\u8981\u5217\u7684\u6392\u5217\u987a\u5e8f\u786e\u5b9a\u4e86\uff0c\u884c\u53ea\u8981\u6392\u4e2a\u5e8f\u5c31\u53ef\u4ee5\u4e86\u3002\u3002\u90a3\u4e48\u6548\u7387\u5c31\u662f(n!*n^2*logn)\u5bf9\u4ed8\u8fd9\u9898n=8\u8db3\u591f\u4e86\u3002\u3002\u6655\u3002\u3002\u771f\u7684\u4e0d\u80fd\u518d\u641e\u7f16\u7a0b\u4e86\u3002\u3002\u8fd8\u67091\u4e2a\u661f\u671f\u5c31\u8981\u6570\u5b66\u7ade\u8d5b\u4e86\u5929\u554a\u3002\u3002\u795e\u554a\u3002\u4fdd\u4f51\u6211\u5427\u56e7\u3002\u3002#include &lt;vector&gt;#include &lt;list&gt;#include &lt;map&gt;#include &lt;set&gt;#include &lt;deque&gt;#include &lt;stack&gt;#include &lt;bitset&gt;#include &lt;algorithm&gt;#include &lt;functional&gt;#include &lt;numeric&gt;#include &lt;utility&gt;#include &lt;sstream&gt;#include &lt;iostream&gt;#include &lt;iomanip&gt;#include &lt;cstdio&gt;#include &lt;cmath&gt;#include &lt;cstdlib&gt;#include &lt;ctime&gt;#define rep(i,n) for(int i=0;i&lt;n;i++)#define pb push_back#define tr(i,x) for(typeof(x.begin()) i=x.begin();i!=x.end();i++)#define all(x) x.begin(),x.end()const int inf=~0U&gt;&gt;1;using namespace std;typedef pair&lt;int,int&gt; ii;typedef vector&lt;int&gt; vi;typedef vi::iterator vit;class MatrixGame {public: vector &lt;string&gt; getMinimal(vector &lt;string&gt;);};int n,m;vector&lt;string&gt; tmp,M,ans;bool used[10]={0};void dfs(int p){ if(p==m) { vector&lt;string&gt; t=tmp; sort(all(t)); [&hellip;]<\/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\/213"}],"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=213"}],"version-history":[{"count":0,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=\/wp\/v2\/posts\/213\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}