{"id":194,"date":"2010-03-27T16:19:00","date_gmt":"2010-03-27T08:19:00","guid":{"rendered":"http:\/\/localhost\/?p=194"},"modified":"2010-03-27T16:19:00","modified_gmt":"2010-03-27T08:19:00","slug":"jsoi2010_group_the_tribes_division_group","status":"publish","type":"post","link":"https:\/\/www.shuizilong.com\/wjmzbmr\/?p=194","title":{"rendered":"[JSOI2010]Group \u90e8\u843d\u5212\u5206 Group"},"content":{"rendered":"\n<p>[JSOI2010]Group \u90e8\u843d\u5212\u5206 Group <\/p>\n<p>Time Limit:10000MS&#160; Memory Limit:65536K<br \/>Total Submit:85 Accepted:33 <br \/>Case Time Limit:1000MS<\/p>\n<p><strong>Description <\/strong><\/p>\n<p> \u806a\u806a\u7814\u7a76\u53d1\u73b0\uff0c\u8352\u5c9b\u91ce\u4eba\u603b\u662f\u8fc7\u7740\u7fa4\u5c45\u7684\u751f\u6d3b\uff0c\u4f46\u662f\uff0c\u5e76\u4e0d\u662f\u6574\u4e2a\u8352\u5c9b\u4e0a\u7684\u6240\u6709\u91ce\u4eba\u90fd\u5c5e\u4e8e\u540c\u4e00\u4e2a\u90e8\u843d\uff0c\u91ce\u4eba\u4eec\u603b\u662f\u62c9\u5e2e\u7ed3\u6d3e\u5f62\u6210\u5c5e\u4e8e\u81ea\u5df1\u7684\u90e8\u843d\uff0c\u4e0d\u540c\u7684\u90e8\u843d\u4e4b\u95f4 \u5219\u7ecf\u5e38\u53d1\u751f\u4e89\u6597\u3002\u53ea\u662f\uff0c\u8fd9\u4e00\u5207\u90fd\u6210\u4e3a\u8c1c\u56e2\u4e86\u2014\u2014\u806a\u806a\u6839\u672c\u5c31\u4e0d\u77e5\u9053\u90e8\u843d\u7a76\u7adf\u662f\u5982\u4f55\u5206\u5e03\u7684\u3002 <\/p>\n<p>\u4e0d\u8fc7\u597d\u6d88\u606f\u662f\uff0c\u806a\u806a\u5f97\u5230\u4e86\u4e00\u4efd\u8352\u5c9b\u7684\u5730\u56fe\u3002\u5730\u56fe\u4e0a\u6807\u6ce8\u4e86N\u4e2a\u91ce\u4eba\u5c45\u4f4f\u7684\u5730\u70b9\uff08\u53ef\u4ee5\u770b\u4f5c\u662f\u5e73\u9762\u4e0a\u7684\u5750\u6807\uff09\u3002\u6211\u4eec\u77e5\u9053\uff0c\u540c\u4e00\u4e2a\u90e8\u843d\u7684\u91ce\u4eba\u603b\u662f\u751f\u6d3b\u5728\u9644 \u8fd1\u3002\u6211\u4eec\u628a\u4e24\u4e2a\u90e8\u843d\u7684\u8ddd\u79bb\uff0c\u5b9a\u4e49\u4e3a\u90e8\u843d\u4e2d\u8ddd\u79bb\u6700\u8fd1\u7684\u90a3\u4e24\u4e2a\u5c45\u4f4f\u70b9\u7684\u8ddd\u79bb\u3002\u806a\u806a\u8fd8\u83b7\u5f97\u4e86\u4e00\u4e2a\u6709\u610f\u4e49\u7684\u4fe1\u606f\u2014\u2014\u8fd9\u4e9b\u91ce\u4eba\u603b\u5171\u88ab\u5206\u4e3a\u4e86K\u4e2a\u90e8\u843d\uff01\u8fd9\u771f\u662f\u4e2a\u597d\u6d88 \u606f\u3002\u806a\u806a\u5e0c\u671b\u4ece\u8fd9\u4e9b\u4fe1\u606f\u91cc\u6316\u6398\u51fa\u6240\u6709\u90e8\u843d\u7684\u8be6\u7ec6\u4fe1\u606f\u3002\u4ed6\u6b63\u5728\u5c1d\u8bd5\u8fd9\u6837\u4e00\u79cd\u7b97\u6cd5\uff1a <\/p>\n<p>\u5bf9\u4e8e\u4efb\u610f\u4e00\u79cd\u90e8\u843d\u5212\u5206\u7684\u65b9\u6cd5\uff0c\u90fd\u80fd\u591f\u6c42\u51fa\u4e24\u4e2a\u90e8\u843d\u4e4b\u95f4\u7684\u8ddd\u79bb\uff0c\u806a\u806a\u5e0c\u671b\u6c42\u51fa\u4e00\u79cd\u90e8\u843d\u5212\u5206\u7684\u65b9\u6cd5\uff0c\u4f7f\u9760\u5f97\u6700\u8fd1\u7684\u4e24\u4e2a\u90e8\u843d\u5c3d\u53ef\u80fd\u8fdc\u79bb\u3002 <br \/>\u4f8b\u5982\uff0c\u4e0b\u9762\u7684\u5de6\u56fe\u8868\u793a\u4e86\u4e00\u4e2a\u597d\u7684\u5212\u5206\uff0c\u800c\u53f3\u56fe\u5219\u4e0d\u662f\u3002\u8bf7\u4f60\u7f16\u7a0b\u5e2e\u52a9\u806a\u806a\u89e3\u51b3\u8fd9\u4e2a\u96be\u9898\u3002 <\/p>\n<p><img decoding=\"async\" src=\"http:\/\/61.187.179.132:8080\/JudgeOnline\/images\/1821.jpg\" \/> <\/p>\n<p><strong>Input <\/strong><\/p>\n<p> \u7b2c\u4e00\u884c\u5305\u542b\u4e24\u4e2a\u6574\u6570N\u548cK(1&lt;=N&lt;=1000,1<\/p>\n<p><strong>Output <\/strong><\/p>\n<p> \u8f93\u51fa\u4e00\u884c\uff0c\u4e3a\u6700\u4f18\u5212\u5206\u65f6\uff0c\u6700\u8fd1\u7684\u4e24\u4e2a\u90e8\u843d\u7684\u8ddd\u79bb\uff0c\u7cbe\u786e\u5230\u5c0f\u6570\u70b9\u540e\u4e24\u4f4d\u3002 <\/p>\n<p><strong>Sample Input <\/strong><\/p>\n<p>4 2<br \/>0 0<br \/>0 1<br \/>1 1<br \/>1 0<\/p>\n<p><strong>Sample Output <\/strong><\/p>\n<p>1.00<\/p>\n<p><strong>Source <\/strong><\/p>\n<p> JSOI2010\u7b2c\u4e8c\u8f6eContest1<br \/>\u88abZJOI\u7684\u9898\u76ee\u8650\u6b7b\u4e86\u56e7\u3002\u3002\u90a3\u4e2aRisk\u8ba1\u7b97\u51e0\u4f55\u592a\u53d8\u6001\u4e86<img decoding=\"async\" src=\"http:\/\/wjmzbmr.com\/wp-content\/uploads\/pic\/other_site\/img_baidu_j_0012.gif\" \/><br \/>\u8fd9\u9898\u597d\u6c34\u554a\u56e7\u3002\u3002\u628a\u6240\u6709\u8ddd\u79bb\u6392\u4e2a\u5e8f\u3002\u7528\u5e76\u67e5\u96c6\u7ef4\u62a4\u8fde\u901a\u6027\u5c31\u53ef\u4ee5\u4e86\u56e7\u3002\u3002<br \/>\u987a\u4fbfOrz\u4e00\u4e0b\u4e2d\u56fd\u8111\u7b4b\u795e\u725b\uff0c\u795e\u725b\u5207\u9898\u771f\u662f\u592a\u795e\u901f\u4e86<img decoding=\"async\" src=\"http:\/\/wjmzbmr.com\/wp-content\/uploads\/pic\/other_site\/img_baidu_w_0008.gif\" \/><br \/>Code\uff1a<\/p>\n<p>#include&lt;cstdio&gt;<br \/>#include&lt;iostream&gt;<br \/>#include&lt;algorithm&gt;<br \/>#include&lt;string&gt;<br \/>#include&lt;vector&gt;<br \/>#include&lt;cstring&gt;<br \/>#include&lt;utility&gt;<br \/>#include&lt;cmath&gt;<br \/>#define rep(i,n) for(int i=0;i&lt;n;i++)<br \/>#define pb push_back<br \/>using namespace std;<br \/>const int inf=~0U&gt;&gt;1,maxn=1000+10;<br \/>typedef pair&lt;int,int&gt; ii;<br \/>typedef pair&lt;int,ii&gt; Edge;<br \/>Edge Es[maxn*maxn\/2];<br \/>ii P[maxn];<br \/>int F[maxn];<br \/>int find(int x){return x==F[x]?x:(F[x]=find(F[x]));}<br \/>int n,k,cnt=0;<br \/>int Dist(ii a,ii b)<br \/>{<br \/>    int x=a.first-b.first,y=a.second-b.second;<br \/>    return x*x+y*y;<br \/>}<br \/>void Init()<br \/>{<br \/>    scanf(&quot;%d %d&quot;,&amp;n,&amp;k);<br \/>    rep(i,n) scanf(&quot;%d %d&quot;,&amp;P[i].first,&amp;P[i].second),F[i]=i;<br \/>    rep(i,n) rep(j,i) Es[cnt++]=Edge(Dist(P[i],P[j]),ii(i,j));<br \/>}<br \/>void Work()<br \/>{<br \/>    sort(Es,Es+cnt);Edge*i=Es;<br \/>    while(true)<br \/>    {<br \/>        int a=i-&gt;second.first,b=i-&gt;second.second;<br \/>        a=find(a),b=find(b);<br \/>        if(a!=b)<br \/>        {<br \/>            if(n&gt;k) F[a]=b,&#8211;n;<br \/>            else{printf(&quot;%0.2lfn&quot;,sqrt(i-&gt;first));break;}<br \/>        }<br \/>        ++i;<br \/>    }<br \/>}<br \/>int main()<br \/>{<br \/>    \/\/freopen(&quot;in&quot;,&quot;r&quot;,stdin);<br \/>    Init();<br \/>    Work();<br \/>}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[JSOI2010]Group \u90e8\u843d\u5212\u5206 Group Time Limit:10000MS&#160; Memory Limit:65536KTotal Submit:85 Accepted:33 Case Time Limit:1000MS Description \u806a\u806a\u7814\u7a76\u53d1\u73b0\uff0c\u8352\u5c9b\u91ce\u4eba\u603b\u662f\u8fc7\u7740\u7fa4\u5c45\u7684\u751f\u6d3b\uff0c\u4f46\u662f\uff0c\u5e76\u4e0d\u662f\u6574\u4e2a\u8352\u5c9b\u4e0a\u7684\u6240\u6709\u91ce\u4eba\u90fd\u5c5e\u4e8e\u540c\u4e00\u4e2a\u90e8\u843d\uff0c\u91ce\u4eba\u4eec\u603b\u662f\u62c9\u5e2e\u7ed3\u6d3e\u5f62\u6210\u5c5e\u4e8e\u81ea\u5df1\u7684\u90e8\u843d\uff0c\u4e0d\u540c\u7684\u90e8\u843d\u4e4b\u95f4 \u5219\u7ecf\u5e38\u53d1\u751f\u4e89\u6597\u3002\u53ea\u662f\uff0c\u8fd9\u4e00\u5207\u90fd\u6210\u4e3a\u8c1c\u56e2\u4e86\u2014\u2014\u806a\u806a\u6839\u672c\u5c31\u4e0d\u77e5\u9053\u90e8\u843d\u7a76\u7adf\u662f\u5982\u4f55\u5206\u5e03\u7684\u3002 \u4e0d\u8fc7\u597d\u6d88\u606f\u662f\uff0c\u806a\u806a\u5f97\u5230\u4e86\u4e00\u4efd\u8352\u5c9b\u7684\u5730\u56fe\u3002\u5730\u56fe\u4e0a\u6807\u6ce8\u4e86N\u4e2a\u91ce\u4eba\u5c45\u4f4f\u7684\u5730\u70b9\uff08\u53ef\u4ee5\u770b\u4f5c\u662f\u5e73\u9762\u4e0a\u7684\u5750\u6807\uff09\u3002\u6211\u4eec\u77e5\u9053\uff0c\u540c\u4e00\u4e2a\u90e8\u843d\u7684\u91ce\u4eba\u603b\u662f\u751f\u6d3b\u5728\u9644 \u8fd1\u3002\u6211\u4eec\u628a\u4e24\u4e2a\u90e8\u843d\u7684\u8ddd\u79bb\uff0c\u5b9a\u4e49\u4e3a\u90e8\u843d\u4e2d\u8ddd\u79bb\u6700\u8fd1\u7684\u90a3\u4e24\u4e2a\u5c45\u4f4f\u70b9\u7684\u8ddd\u79bb\u3002\u806a\u806a\u8fd8\u83b7\u5f97\u4e86\u4e00\u4e2a\u6709\u610f\u4e49\u7684\u4fe1\u606f\u2014\u2014\u8fd9\u4e9b\u91ce\u4eba\u603b\u5171\u88ab\u5206\u4e3a\u4e86K\u4e2a\u90e8\u843d\uff01\u8fd9\u771f\u662f\u4e2a\u597d\u6d88 \u606f\u3002\u806a\u806a\u5e0c\u671b\u4ece\u8fd9\u4e9b\u4fe1\u606f\u91cc\u6316\u6398\u51fa\u6240\u6709\u90e8\u843d\u7684\u8be6\u7ec6\u4fe1\u606f\u3002\u4ed6\u6b63\u5728\u5c1d\u8bd5\u8fd9\u6837\u4e00\u79cd\u7b97\u6cd5\uff1a \u5bf9\u4e8e\u4efb\u610f\u4e00\u79cd\u90e8\u843d\u5212\u5206\u7684\u65b9\u6cd5\uff0c\u90fd\u80fd\u591f\u6c42\u51fa\u4e24\u4e2a\u90e8\u843d\u4e4b\u95f4\u7684\u8ddd\u79bb\uff0c\u806a\u806a\u5e0c\u671b\u6c42\u51fa\u4e00\u79cd\u90e8\u843d\u5212\u5206\u7684\u65b9\u6cd5\uff0c\u4f7f\u9760\u5f97\u6700\u8fd1\u7684\u4e24\u4e2a\u90e8\u843d\u5c3d\u53ef\u80fd\u8fdc\u79bb\u3002 \u4f8b\u5982\uff0c\u4e0b\u9762\u7684\u5de6\u56fe\u8868\u793a\u4e86\u4e00\u4e2a\u597d\u7684\u5212\u5206\uff0c\u800c\u53f3\u56fe\u5219\u4e0d\u662f\u3002\u8bf7\u4f60\u7f16\u7a0b\u5e2e\u52a9\u806a\u806a\u89e3\u51b3\u8fd9\u4e2a\u96be\u9898\u3002 Input \u7b2c\u4e00\u884c\u5305\u542b\u4e24\u4e2a\u6574\u6570N\u548cK(1&lt;=N&lt;=1000,1 Output \u8f93\u51fa\u4e00\u884c\uff0c\u4e3a\u6700\u4f18\u5212\u5206\u65f6\uff0c\u6700\u8fd1\u7684\u4e24\u4e2a\u90e8\u843d\u7684\u8ddd\u79bb\uff0c\u7cbe\u786e\u5230\u5c0f\u6570\u70b9\u540e\u4e24\u4f4d\u3002 Sample Input 4 20 00 11 11 0 Sample Output 1.00 Source JSOI2010\u7b2c\u4e8c\u8f6eContest1\u88abZJOI\u7684\u9898\u76ee\u8650\u6b7b\u4e86\u56e7\u3002\u3002\u90a3\u4e2aRisk\u8ba1\u7b97\u51e0\u4f55\u592a\u53d8\u6001\u4e86\u8fd9\u9898\u597d\u6c34\u554a\u56e7\u3002\u3002\u628a\u6240\u6709\u8ddd\u79bb\u6392\u4e2a\u5e8f\u3002\u7528\u5e76\u67e5\u96c6\u7ef4\u62a4\u8fde\u901a\u6027\u5c31\u53ef\u4ee5\u4e86\u56e7\u3002\u3002\u987a\u4fbfOrz\u4e00\u4e0b\u4e2d\u56fd\u8111\u7b4b\u795e\u725b\uff0c\u795e\u725b\u5207\u9898\u771f\u662f\u592a\u795e\u901f\u4e86Code\uff1a #include&lt;cstdio&gt;#include&lt;iostream&gt;#include&lt;algorithm&gt;#include&lt;string&gt;#include&lt;vector&gt;#include&lt;cstring&gt;#include&lt;utility&gt;#include&lt;cmath&gt;#define rep(i,n) for(int i=0;i&lt;n;i++)#define pb push_backusing namespace std;const int inf=~0U&gt;&gt;1,maxn=1000+10;typedef pair&lt;int,int&gt; ii;typedef pair&lt;int,ii&gt; Edge;Edge Es[maxn*maxn\/2];ii P[maxn];int F[maxn];int find(int [&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\/194"}],"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=194"}],"version-history":[{"count":0,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=\/wp\/v2\/posts\/194\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=194"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}