锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久这里只有精品视频99,亚洲va久久久噜噜噜久久男同 ,人人妻久久人人澡人人爽人人精品http://m.shnenglu.com/guodongshan/category/15094.htmlzh-cnWed, 06 Oct 2010 05:41:15 GMTWed, 06 Oct 2010 05:41:15 GMT60HDU1875 鐣呴氬伐紼嬪啀緇?鏈灝忕敓鎴愭爲http://m.shnenglu.com/guodongshan/archive/2010/10/06/128762.html瀛熻搗瀛熻搗Wed, 06 Oct 2010 02:26:00 GMThttp://m.shnenglu.com/guodongshan/archive/2010/10/06/128762.htmlhttp://m.shnenglu.com/guodongshan/comments/128762.htmlhttp://m.shnenglu.com/guodongshan/archive/2010/10/06/128762.html#Feedback0http://m.shnenglu.com/guodongshan/comments/commentRss/128762.htmlhttp://m.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://m.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://m.shnenglu.com/guodongshan/archive/2010/10/06/128756.html</guid><wfw:comment>http://m.shnenglu.com/guodongshan/comments/128756.html</wfw:comment><comments>http://m.shnenglu.com/guodongshan/archive/2010/10/06/128756.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/guodongshan/comments/commentRss/128756.html</wfw:commentRss><trackback:ping>http://m.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://m.shnenglu.com/guodongshan/aggbug/128756.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/guodongshan/" target="_blank">瀛熻搗</a> 2010-10-06 09:23 <a href="http://m.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://m.shnenglu.com/" title="精品视频久久久久">精品视频久久久久</a> <div class="friend-links"> </div> </div> </footer> <a href="http://www.xajh2.cn" target="_blank">亚洲中文字幕无码一久久区 </a>| <a href="http://www.ht228.cn" target="_blank">亚洲精品国产自在久久</a>| <a href="http://www.jituansms.cn" target="_blank">久久国产精品77777</a>| <a href="http://www.918jj.cn" target="_blank">久久天天躁狠狠躁夜夜网站</a>| <a href="http://www.tmqywedding.cn" target="_blank">97精品伊人久久大香线蕉</a>| <a href="http://www.ireboot.cn" target="_blank">亚洲美日韩Av中文字幕无码久久久妻妇</a>| <a href="http://www.xhqb2000.com.cn" target="_blank">国产精品九九久久精品女同亚洲欧美日韩综合区 </a>| <a href="http://www.fjzgh.cn" target="_blank">99久久人人爽亚洲精品美女</a>| <a href="http://www.mengyun868.cn" target="_blank">国产成人精品久久亚洲高清不卡</a>| <a href="http://www.silverprice.net.cn" target="_blank">亚洲国产成人久久综合一 </a>| <a href="http://www.07ww.cn" target="_blank">国内精品久久久久影院优</a>| <a href="http://www.gzmxjc.cn" target="_blank">99re这里只有精品热久久</a>| <a href="http://www.bjhswt.com.cn" target="_blank">91久久香蕉国产熟女线看</a>| <a href="http://www.masterdan.cn" target="_blank">久久毛片免费看一区二区三区</a>| <a href="http://www.ekqz.cn" target="_blank">一本久久精品一区二区</a>| <a href="http://www.mdwmp.com.cn" target="_blank">久久九九精品99国产精品</a>| <a href="http://www.hm661.cn" target="_blank">成人a毛片久久免费播放</a>| <a href="http://www.h8443.cn" target="_blank">免费精品国产日韩热久久</a>| <a href="http://www.51s8s.cn" target="_blank">久久综合给合久久狠狠狠97色</a>| <a href="http://www.xcvcd.cn" target="_blank">四虎国产精品免费久久久</a>| <a href="http://www.lnsmgg.cn" target="_blank">色婷婷噜噜久久国产精品12p </a>| <a href="http://www.650qq.cn" target="_blank">亚洲七七久久精品中文国产</a>| <a href="http://www.linux123.cn" target="_blank">久久亚洲精品国产精品</a>| <a href="http://www.c6t9.cn" target="_blank">人妻无码精品久久亚瑟影视</a>| <a href="http://www.338net.cn" target="_blank">91精品国产乱码久久久久久</a>| <a href="http://www.ggfuns.cn" target="_blank">亚洲国产精品无码久久久久久曰</a>| <a href="http://www.mx3g.cn" target="_blank">精品久久久久久无码专区不卡</a>| <a href="http://www.czqxj.cn" target="_blank">久久免费99精品国产自在现线</a>| <a href="http://www.mynyf8.cn" target="_blank">99精品国产在热久久</a>| <a href="http://www.zhaobiao365.cn" target="_blank">亚洲国产成人久久综合区</a>| <a href="http://www.net901.cn" target="_blank">色综合久久久久</a>| <a href="http://www.a-house.com.cn" target="_blank">久久精品天天中文字幕人妻</a>| <a href="http://www.icsy.cn" target="_blank">亚洲国产成人精品无码久久久久久综合</a>| <a href="http://www.modim.cn" target="_blank">久久偷看各类wc女厕嘘嘘</a>| <a href="http://www.pbkf.net.cn" target="_blank">欧美亚洲国产精品久久</a>| <a href="http://www.pf925.cn" target="_blank">久久影院亚洲一区</a>| <a href="http://www.zzyes.cn" target="_blank">久久九九久精品国产免费直播</a>| <a href="http://www.yuzeyuanyi.cn" target="_blank">久久91精品久久91综合</a>| <a href="http://www.jn533.cn" target="_blank">91久久婷婷国产综合精品青草</a>| <a href="http://www.qiaokuo.cn" target="_blank">波多野结衣久久精品</a>| <a href="http://www.ofjf.cn" target="_blank">中文成人无码精品久久久不卡</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>