锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产日韩久久久精品影院首页,国产精品久久久久aaaa,久久久久亚洲av无码专区 http://www.shnenglu.com/guodongshan/category/15094.htmlzh-cnWed, 06 Oct 2010 05:41:15 GMTWed, 06 Oct 2010 05:41:15 GMT60HDU1875 鐣呴氬伐紼嬪啀緇?鏈灝忕敓鎴愭爲http://www.shnenglu.com/guodongshan/archive/2010/10/06/128762.html瀛熻搗瀛熻搗Wed, 06 Oct 2010 02:26:00 GMThttp://www.shnenglu.com/guodongshan/archive/2010/10/06/128762.htmlhttp://www.shnenglu.com/guodongshan/comments/128762.htmlhttp://www.shnenglu.com/guodongshan/archive/2010/10/06/128762.html#Feedback0http://www.shnenglu.com/guodongshan/comments/commentRss/128762.htmlhttp://www.shnenglu.com/guodongshan/services/trackbacks/128762.htmlhttp://acm.hdu.edu.cn/showproblem.php?pid=1875

Kruscal鏈灝忕敓鎴愭爲 娉ㄦ剰瀵筪ouble綾誨瀷鐨勫揩鎺掑彲涓嶈鍐欓敊浜?
#include<stdio.h>
#include
<stdlib.h>
#include
<math.h>
struct road{
    
int x,y;
    
double v;
}r[
5002];
struct point{
    
int a,b;
}p[
102];
int cmp(const void *a,const void *b)
{
    
struct road *aa=(struct road *)a;
    
struct road *bb=(struct road *)b;
    
return aa->> bb->? 1:-1;
}
int bin[102];
int find(int x)
{
    
int r=x;
    
while(bin[r]!=r)
        r
=bin[r];
    
int y=x;
    
while(bin[y]!=y)
    {
        y
=bin[y];
        bin[y]
=r;
    }
    
return r;
}
int main()
{
    
int t,n,i,j,num,cnt;
    
double ans;
    scanf(
"%d",&t);
    
while(t--)
    {
        scanf(
"%d",&n);
        
for(i=0;i<n;i++)
            scanf(
"%d%d",&p[i].a,&p[i].b);
        num
=0;
        
for(i=0;i<n-1;i++)
            
for(j=i+1;j<n;j++){
                r[num].x
=i,  r[num].y=j;
                r[num].v
=sqrt(1.0*(p[i].a-p[j].a)*(p[i].a-p[j].a)+(p[i].b-p[j].b)*(p[i].b-p[j].b));
                num
++;
            }
        
for(i=0;i<n;i++)
            bin[i]
=i;
        qsort(r,num,
sizeof(r[0]),cmp);
        i
=0; ans=0; cnt=0;
        
while(r[i].v<10)
            i
++;
        
for(;i<num && cnt<n-1;i++)
        {
            
if(r[i].v>1000break;
            
int fx=find(r[i].x), fy=find(r[i].y);
            
if(fx!=fy)
            {
                bin[fx]
=fy;
                cnt
++;
                ans
+=r[i].v;
            }
        }
        
if(cnt==n-1)
            printf(
"%.1lf\n",ans*100);
        
else
            printf(
"oh!\n");
    }
    
return 0;
}


瀛熻搗 2010-10-06 10:26 鍙戣〃璇勮
]]>
HDU1874 鐣呴氬伐紼嬬畫 鍗曟簮鏈鐭礬寰?/title><link>http://www.shnenglu.com/guodongshan/archive/2010/10/06/128756.html</link><dc:creator>瀛熻搗</dc:creator><author>瀛熻搗</author><pubDate>Wed, 06 Oct 2010 01:23:00 GMT</pubDate><guid>http://www.shnenglu.com/guodongshan/archive/2010/10/06/128756.html</guid><wfw:comment>http://www.shnenglu.com/guodongshan/comments/128756.html</wfw:comment><comments>http://www.shnenglu.com/guodongshan/archive/2010/10/06/128756.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/guodongshan/comments/commentRss/128756.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/guodongshan/services/trackbacks/128756.html</trackback:ping><description><![CDATA[鏈綆鍗曠殑dijkstra搴旂敤錛屽埆鐨勫氨涓嶈浜?棰樼洰閾炬帴錛?a target=_blank>http://acm.hdu.edu.cn/showproblem.php?pid=1874</a><br> <div style="BORDER-BOTTOM: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; PADDING-BOTTOM: 4px; BACKGROUND-COLOR: #eeeeee; PADDING-LEFT: 4px; WIDTH: 98%; PADDING-RIGHT: 5px; FONT-SIZE: 13px; WORD-BREAK: break-all; BORDER-TOP: #cccccc 1px solid; BORDER-RIGHT: #cccccc 1px solid; PADDING-TOP: 4px"><span style="COLOR: #000000">#include</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">stdio.h</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br>#include</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">.h</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> MAXN 201</span><span style="COLOR: #000000"><br></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> MAX 999999</span><span style="COLOR: #000000"><br></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> dist[MAXN][MAXN],x[MAXN];<br></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> main()<br>{<br>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> n,m,i,j,t,s,d,a,b,time,min;<br>    </span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000">(scanf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%d%d</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">n,</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">m)</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">)<br>    {<br>        </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;i</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">n;i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>        {<br>            </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(j</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;j</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">n;j</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>            {<br>                </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(i</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">j)<br>                    dist[i][j]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br>                </span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000"><br>                    dist[i][j]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">MAX;<br>            }<br>        }<br>        </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;i</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">m;i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>        {<br>            scanf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%d%d%d</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">a,</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">b,</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">time);<br>            dist[a][b]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">dist[b][a]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">time</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">dist[a][b]</span><span style="COLOR: #000000">?</span><span style="COLOR: #000000">time:dist[a][b];<br>        }<br>        scanf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%d%d</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">s,</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">d);<br>        </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;i</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">n;i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>        x[i]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">dist[s][i];<br>        dist[s][s]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">;<br>        t</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br>        </span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000">(t</span><span style="COLOR: #000000">!=-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">)<br>        {<br>            min</span><span style="COLOR: #000000">=-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">;<br>            t</span><span style="COLOR: #000000">=-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">;<br>            </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;i</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">n;i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>            </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(dist[i][i]</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">&&</span><span style="COLOR: #000000">(min</span><span style="COLOR: #000000">==-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">||</span><span style="COLOR: #000000">x[i]</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">min))<br>            {<br>                min</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">x[i];<br>                t</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">i;<br>            }<br>            </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(t</span><span style="COLOR: #000000">!=-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">)<br>            {<br>                dist[t][t]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">;<br>                </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;i</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">n;i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>                </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(x[i]</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">x[t]</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">dist[t][i])<br>                {<br>                    x[i]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">x[t]</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">dist[t][i];<br>                }<br>            }<br>        }<br>        </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(x[d]</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">MAX)<br>            printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%d\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,x[d]);<br>        </span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000"><br>            printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">-1\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br>    }<br>    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br>}</span></div> <img src ="http://www.shnenglu.com/guodongshan/aggbug/128756.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/guodongshan/" target="_blank">瀛熻搗</a> 2010-10-06 09:23 <a href="http://www.shnenglu.com/guodongshan/archive/2010/10/06/128756.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.shnenglu.com/" title="精品视频久久久久">精品视频久久久久</a> <div class="friend-links"> </div> </div> </footer> <a href="http://www.focuan.cn" target="_blank">久久91精品国产91久久小草</a>| <a href="http://www.pkjx.net.cn" target="_blank">久久久精品午夜免费不卡</a>| <a href="http://www.34lz.cn" target="_blank">久久无码精品一区二区三区</a>| <a href="http://www.xx5a4.cn" target="_blank">亚洲欧美久久久久9999</a>| <a href="http://www.208dj.cn" target="_blank">无码人妻久久一区二区三区免费丨</a>| <a href="http://www.hhjzw.cn" target="_blank">亚洲AV无码久久寂寞少妇</a>| <a href="http://www.movie38.cn" target="_blank">久久青青草原精品国产软件</a>| <a href="http://www.jkmdz.cn" target="_blank">久久人做人爽一区二区三区</a>| <a href="http://www.3495.com.cn" target="_blank">久久久久人妻一区精品性色av</a>| <a href="http://www.034867.cn" target="_blank">亚洲国产成人久久精品动漫</a>| <a href="http://www.buy162.cn" target="_blank">伊人色综合久久天天人守人婷</a>| <a href="http://www.cs556.cn" target="_blank">久久99国产精品久久久</a>| <a href="http://www.sms321.cn" target="_blank">思思久久好好热精品国产</a>| <a href="http://www.anfubbs.cn" target="_blank">国内精品久久久久影院日本</a>| <a href="http://www.0513act.cn" target="_blank">久久强奷乱码老熟女网站</a>| <a href="http://www.shenghuigd.com.cn" target="_blank">日韩人妻无码一区二区三区久久</a>| <a href="http://www.ahhncl.cn" target="_blank">久久九九久精品国产</a>| <a href="http://www.dztsc.cn" target="_blank">国产精品久久久久AV福利动漫</a>| <a href="http://www.gbpa.cn" target="_blank">亚洲第一永久AV网站久久精品男人的天堂AV</a>| <a href="http://www.wzwsbz.cn" target="_blank">久久精品成人免费观看97</a>| <a href="http://www.cnfeiting.cn" target="_blank">欧美午夜精品久久久久免费视</a>| <a href="http://www.163sms.cn" target="_blank">久久天天躁狠狠躁夜夜2020</a>| <a href="http://www.5yfyf.cn" target="_blank">久久国产精品99久久久久久老狼</a>| <a href="http://www.gdchengye.com.cn" target="_blank">久久久噜噜噜久久</a>| <a href="http://www.vwdg.cn" target="_blank">99久久国产综合精品五月天喷水 </a>| <a href="http://www.gpfo.cn" target="_blank">综合人妻久久一区二区精品</a>| <a href="http://www.mumahack.com.cn" target="_blank">久久成人国产精品二三区</a>| <a href="http://www.lianyigs.cn" target="_blank">久久午夜福利无码1000合集</a>| <a href="http://www.apcu.cn" target="_blank">久久伊人色</a>| <a href="http://www.4000261688.cn" target="_blank">思思久久99热免费精品6</a>| <a href="http://www.xingezhijia.cn" target="_blank">精品综合久久久久久88小说</a>| <a href="http://www.songli.org.cn" target="_blank">久久99国内精品自在现线</a>| <a href="http://www.taiguolu.com.cn" target="_blank">亚洲国产另类久久久精品</a>| <a href="http://www.shawcai.cn" target="_blank">久久久久亚洲精品日久生情</a>| <a href="http://www.ahhncl.cn" target="_blank">国产精品久久久久久久app</a>| <a href="http://www.webidea.com.cn" target="_blank">国内精品久久久久久麻豆</a>| <a href="http://www.desktx.cn" target="_blank">99久久国产热无码精品免费久久久久</a>| <a href="http://www.hsjituan.com.cn" target="_blank">伊人久久综合无码成人网</a>| <a href="http://www.7dapei.cn" target="_blank">日韩人妻无码精品久久久不卡 </a>| <a href="http://www.0769zc.net.cn" target="_blank">97久久精品人人澡人人爽</a>| <a href="http://www.51saer.cn" target="_blank">色偷偷888欧美精品久久久</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>