锘??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.myswiss.cn" target="_blank">无码超乳爆乳中文字幕久久</a>| <a href="http://www.lstweb.cn" target="_blank">精品少妇人妻av无码久久</a>| <a href="http://www.fzlqb.cn" target="_blank">91精品国产91久久</a>| <a href="http://www.njglqw.org.cn" target="_blank">久久99国产精品一区二区</a>| <a href="http://www.wzcl818.cn" target="_blank">国产精品99久久精品</a>| <a href="http://www.www5303.cn" target="_blank">国内精品久久久久久中文字幕</a>| <a href="http://www.nmgr.net.cn" target="_blank">久久亚洲精品国产精品婷婷</a>| <a href="http://www.zmcgmih22.cn" target="_blank">国产精品乱码久久久久久软件</a>| <a href="http://www.keyuehua.cn" target="_blank">久久笫一福利免费导航</a>| <a href="http://www.woman365.cn" target="_blank">久久精品亚洲一区二区三区浴池</a>| <a href="http://www.essledyntp.com.cn" target="_blank">99re这里只有精品热久久</a>| <a href="http://www.52yydy.cn" target="_blank">久久毛片免费看一区二区三区</a>| <a href="http://www.c118c.cn" target="_blank">一本色道久久综合狠狠躁</a>| <a href="http://www.xhqb2000.com.cn" target="_blank">日韩亚洲欧美久久久www综合网</a>| <a href="http://www.csffh.cn" target="_blank">一级A毛片免费观看久久精品</a>| <a href="http://www.longfee.cn" target="_blank">久久99国内精品自在现线</a>| <a href="http://www.yw33777.cn" target="_blank">女人高潮久久久叫人喷水</a>| <a href="http://www.veixzew.cn" target="_blank">99精品久久精品一区二区</a>| <a href="http://www.6dou.net.cn" target="_blank">思思久久99热只有频精品66</a>| <a href="http://www.hgd625028888.cn" target="_blank">青青青伊人色综合久久</a>| <a href="http://www.sh-richardmille.cn" target="_blank">亚洲αv久久久噜噜噜噜噜</a>| <a href="http://www.odbgw.cn" target="_blank">久久精品国产亚洲一区二区三区</a>| <a href="http://www.dongfangmoney.cn" target="_blank">色综合久久中文字幕无码</a>| <a href="http://www.pgt.net.cn" target="_blank">欧美一级久久久久久久大片</a>| <a href="http://www.ggfuns.cn" target="_blank">久久久久久久尹人综合网亚洲 </a>| <a href="http://www.vzpw.cn" target="_blank">四虎国产精品免费久久久</a>| <a href="http://www.webfi.cn" target="_blank">伊人久久大香线蕉AV一区二区</a>| <a href="http://www.zupy.cn" target="_blank">久久久九九有精品国产</a>| <a href="http://www.ynxcm.cn" target="_blank">国产精品美女久久久m</a>| <a href="http://www.djl0320.cn" target="_blank">亚洲级αV无码毛片久久精品</a>| <a href="http://www.hwwy.net.cn" target="_blank">欧美一级久久久久久久大片</a>| <a href="http://www.reln.cn" target="_blank">久久强奷乱码老熟女网站</a>| <a href="http://www.epcinet.cn" target="_blank">久久99热精品</a>| <a href="http://www.1118.org.cn" target="_blank">久久久精品一区二区三区</a>| <a href="http://www.rongchenjiaxiao.cn" target="_blank">日韩人妻无码一区二区三区久久</a>| <a href="http://www.sjpeixun.cn" target="_blank">欧美日韩中文字幕久久久不卡</a>| <a href="http://www.uuu9com.cn" target="_blank">久久99精品国产麻豆不卡</a>| <a href="http://www.silverprice.net.cn" target="_blank">日本久久久精品中文字幕</a>| <a href="http://www.jkzgjkzl.org.cn" target="_blank">久久亚洲国产精品一区二区</a>| <a href="http://www.cn0317.cn" target="_blank">99久久综合狠狠综合久久止</a>| <a href="http://www.hzlike.cn" target="_blank">久久天天躁狠狠躁夜夜躁2O2O</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>