锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久这里只有精品视频99,亚洲va久久久噜噜噜久久男同 ,人人妻久久人人澡人人爽人人精品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.0771008.cn" target="_blank">2022年国产精品久久久久</a>| <a href="http://www.681lc.cn" target="_blank">久久国产精品视频</a>| <a href="http://www.myswiss.cn" target="_blank">久久久av波多野一区二区</a>| <a href="http://www.wannianl.cn" target="_blank">久久ww精品w免费人成</a>| <a href="http://www.desktx.cn" target="_blank">亚洲一区二区三区日本久久九</a>| <a href="http://www.kxblogs.cn" target="_blank">久久久久久久国产免费看</a>| <a href="http://www.hgrnoko.cn" target="_blank">久久久www免费人成精品</a>| <a href="http://www.vqzt.cn" target="_blank">99久久精品费精品国产一区二区</a>| <a href="http://www.360shouji.net.cn" target="_blank">国产欧美久久一区二区</a>| <a href="http://www.sdtra.cn" target="_blank">久久婷婷色综合一区二区</a>| <a href="http://www.kklnpfvjt.cn" target="_blank">久久久久久精品免费免费自慰 </a>| <a href="http://www.mingxiao123.cn" target="_blank">色欲综合久久中文字幕网</a>| <a href="http://www.shensizxw.cn" target="_blank">久久国产精品久久精品国产</a>| <a href="http://www.fyjzhxf.cn" target="_blank">亚洲国产成人久久综合野外</a>| <a href="http://www.fanglan-tech.cn" target="_blank">国产成人精品白浆久久69</a>| <a href="http://www.lepinw.cn" target="_blank">成人综合久久精品色婷婷</a>| <a href="http://www.cnfeiting.cn" target="_blank">国产成人香蕉久久久久</a>| <a href="http://www.suba400.cn" target="_blank">久久国产精品77777</a>| <a href="http://www.dlucai.cn" target="_blank">99久久香蕉国产线看观香</a>| <a href="http://www.gloven.cn" target="_blank">国产精品欧美久久久久天天影视</a>| <a href="http://www.ampul.cn" target="_blank">人妻无码αv中文字幕久久</a>| <a href="http://www.gsappxz.cn" target="_blank">久久精品国产黑森林</a>| <a href="http://www.cn-sina.cn" target="_blank">国产精品青草久久久久婷婷 </a>| <a href="http://www.td16yf8g.cn" target="_blank">久久嫩草影院免费看夜色</a>| <a href="http://www.bbs0310.cn" target="_blank">国产精品久久自在自线观看</a>| <a href="http://www.uhqw.cn" target="_blank">久久精品无码一区二区WWW</a>| <a href="http://www.mir716.cn" target="_blank">久久人人超碰精品CAOPOREN</a>| <a href="http://www.z718.cn" target="_blank">久久亚洲国产欧洲精品一</a>| <a href="http://www.adddi.cn" target="_blank">久久久久久国产精品无码超碰</a>| <a href="http://www.jytextile.cn" target="_blank">久久笫一福利免费导航 </a>| <a href="http://www.yuyuetiyu.cn" target="_blank">精品伊人久久大线蕉色首页</a>| <a href="http://www.flznzb.cn" target="_blank">亚洲欧洲中文日韩久久AV乱码</a>| <a href="http://www.pass3d.cn" target="_blank">国产精品免费久久久久影院</a>| <a href="http://www.uzxin.cn" target="_blank">亚洲国产精品一区二区久久</a>| <a href="http://www.baizen.cn" target="_blank">精品久久香蕉国产线看观看亚洲 </a>| <a href="http://www.laopaiwaihui.cn" target="_blank">久久精品午夜一区二区福利</a>| <a href="http://www.rfgjqh.cn" target="_blank">精品久久久久久久国产潘金莲 </a>| <a href="http://www.413qq.cn" target="_blank">91精品国产色综合久久</a>| <a href="http://www.jumbo8.cn" target="_blank">久久精品人人做人人爽97</a>| <a href="http://www.rh-hr.cn" target="_blank">7777久久久国产精品消防器材</a>| <a href="http://www.208dj.cn" target="_blank">亚洲成av人片不卡无码久久</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>