锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产精品久久久久久久久免费,日韩精品久久久久久免费,伊人色综合久久天天人手人婷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.8x8z.cn" target="_blank">97久久综合精品久久久综合</a>| <a href="http://www.psia.cn" target="_blank">久久中文精品无码中文字幕</a>| <a href="http://www.qdaigo.com.cn" target="_blank">婷婷伊人久久大香线蕉AV </a>| <a href="http://www.swd5.cn" target="_blank">国产成人久久精品二区三区</a>| <a href="http://www.cpp521.cn" target="_blank">久久国产精品99久久久久久老狼</a>| <a href="http://www.xmxfz.cn" target="_blank">国产精品免费久久久久电影网</a>| <a href="http://www.sanxiangcn.cn" target="_blank">久久久久亚洲AV无码专区桃色</a>| <a href="http://www.ahhncl.cn" target="_blank">久久99国产精品久久99小说 </a>| <a href="http://www.rycc99.cn" target="_blank">久久综合久久综合九色</a>| <a href="http://www.schoenhut.com.cn" target="_blank">狠狠色综合网站久久久久久久</a>| <a href="http://www.awhahzm.cn" target="_blank">精品国产日韩久久亚洲</a>| <a href="http://www.spxian.cn" target="_blank">久久久九九有精品国产</a>| <a href="http://www.hystech.cn" target="_blank">亚洲精品国产第一综合99久久</a>| <a href="http://www.ffcchh.com.cn" target="_blank">国产精品女同久久久久电影院</a>| <a href="http://www.alexa178.cn" target="_blank">精品人妻伦一二三区久久</a>| <a href="http://www.023job.com.cn" target="_blank">久久综合久久自在自线精品自</a>| <a href="http://www.wubaili.com.cn" target="_blank">91精品免费久久久久久久久</a>| <a href="http://www.sky1314.cn" target="_blank">亚洲AV日韩AV天堂久久</a>| <a href="http://www.yxcyfa.cn" target="_blank">久久狠狠一本精品综合网</a>| <a href="http://www.blog91.cn" target="_blank">久久国产精品无码一区二区三区</a>| <a href="http://www.splh.net.cn" target="_blank">热RE99久久精品国产66热</a>| <a href="http://www.longyan8.cn" target="_blank">99久久精品无码一区二区毛片</a>| <a href="http://www.bitpter.cn" target="_blank">欧美熟妇另类久久久久久不卡</a>| <a href="http://www.my1983.cn" target="_blank">无码精品久久一区二区三区</a>| <a href="http://www.okboom.cn" target="_blank">国产—久久香蕉国产线看观看 </a>| <a href="http://www.nanling888.cn" target="_blank">久久久久97国产精华液好用吗</a>| <a href="http://www.zzouyi.cn" target="_blank">91久久精一区二区三区大全</a>| <a href="http://www.uubux.com.cn" target="_blank">久久精品国产亚洲AV久</a>| <a href="http://www.z718.cn" target="_blank">久久久久99这里有精品10</a>| <a href="http://www.bjhswt.com.cn" target="_blank">91麻豆精品国产91久久久久久</a>| <a href="http://www.paysearch.cn" target="_blank">97久久精品无码一区二区</a>| <a href="http://www.z5621.cn" target="_blank">国产精品无码久久久久久</a>| <a href="http://www.950aw.cn" target="_blank">精品无码久久久久久尤物</a>| <a href="http://www.gmlu.cn" target="_blank">久久久久亚洲AV无码专区体验</a>| <a href="http://www.jsmyy.cn" target="_blank">欧美精品久久久久久久自慰</a>| <a href="http://www.yd-job.cn" target="_blank">性高湖久久久久久久久</a>| <a href="http://www.khdv.cn" target="_blank">亚洲成色WWW久久网站</a>| <a href="http://www.mono2018.cn" target="_blank">久久综合狠狠综合久久综合88</a>| <a href="http://www.shop219.cn" target="_blank">亚洲午夜久久久久久久久久 </a>| <a href="http://www.huodiba.cn" target="_blank">日韩精品无码久久一区二区三</a>| <a href="http://www.aidelu.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>