• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            #include? < iostream >
            #include?
            < cmath >
            #include?
            < limits >

            struct ?Point
            {
            ????
            int ?x,y;
            }
            ;

            double ?graph[ 201 ][ 201 ];
            Point???data[
            201 ];
            int ?????n;
            bool ????visite[ 201 ];
            double ??result[ 201 ];

            double ?Distance(?Point & ?a,?Point & ?b?)
            {
            ????
            return ?sqrt(?( double )(?(a.x - ?b.x) * ?(a.x - ?b.x?) + ?(a.y - ?b.y?) * ?(a.y - ?b.y?)?)?);
            }


            void ?shortpath(? int ?t?)
            {
            ????
            for ?(? int ?i = ? 1 ;?i <= ?n;? ++ i?)
            ????
            {
            ????????visite[i]
            = ? false ;
            ????????result[i]
            = ? 0.0 ;
            ????}


            ????
            for ?(? int ?i = ? 1 ;?i <= ?n;? ++ i?)
            ????????result[i]
            = ?graph[t][i];

            ????visite[t]
            = ? true ;
            ????
            for ?(? int ?i = ? 1 ;?i <= ?n - ? 1 ;? ++ i?)
            ????
            {
            ????????
            double ?min = ?std::numeric_limits < double > ::max();

            ????????
            int ?k = ? - 1 ;
            ????????
            for ?(? int ?j = ? 1 ;?j <= ?n;? ++ j?)
            ????????????
            if ?(? ! visite[j]? && ?result[j] < ?min?)
            ????????????
            {
            ????????????????min
            = ?result[j];
            ????????????????k
            = ?j;
            ????????????}


            ????????visite[k]
            = ? true ;
            ????????
            for ?(? int ?j = ? 1 ;?j <= ?n;? ++ j?)
            ????????????
            if ?(? ! visite[j]? && ?std::max(?graph[k][j],?result[k]?) < ?result[j]?)
            ????????????????result[j]
            = ?std::max(?graph[k][j],?result[k]?);
            ????}

            }


            int ?main()
            {
            ????
            int ?num = ? 1 ;
            ????
            while (?scanf( " %d " , & n),?n != ? 0 ?)
            ????
            {
            ????????
            for ?(? int ?i = ? 1 ;?i <= ?n;? ++ i?)
            ????????????scanf(
            " %d%d " ,? & data[i].x,? & data[i].y?);

            ????????
            for ?(? int ?i = ? 1 ;?i <= ?n;? ++ i?)
            ????????????
            for ?(? int ?j = ? 1 ;?j <= ?n;? ++ j?)
            ????????????????graph[i][j]
            = ?Distance(?data[i],?data[j]?);

            ????????shortpath(
            1 );
            ????????printf(
            " Scenario?#%d\n " ,?num ++ ?);
            ????????printf(
            " Frog?Distance?=?%.3lf\n " ,?result[ 2 ]?);
            ????????printf(
            " \n " );
            ????}


            ????
            return ? 0 ;
            }
            posted on 2008-10-02 15:24 Darren 閱讀(246) 評論(0)  編輯 收藏 引用 所屬分類: 圖論
            国产午夜久久影院| 久久精品麻豆日日躁夜夜躁| 久久久WWW成人| 欧美午夜A∨大片久久| 99久久国产亚洲综合精品| 性色欲网站人妻丰满中文久久不卡| 久久久久国产精品人妻| 国产精品国色综合久久| 久久黄色视频| 国内精品久久久久久野外| 久久无码精品一区二区三区| 精品久久亚洲中文无码| 久久夜色精品国产亚洲| 亚洲日韩欧美一区久久久久我| 久久中文骚妇内射| 狠狠色丁香久久婷婷综合图片 | 久久亚洲国产中v天仙www| 久久久久婷婷| 久久精品一区二区国产| 99精品国产综合久久久久五月天 | 色诱久久av| 青青草国产精品久久| 亚洲精品无码久久久久去q| 久久精品国产欧美日韩| 久久福利青草精品资源站免费| 久久久久久亚洲精品影院| 国产一区二区精品久久岳| 99国产精品久久久久久久成人热| 成人久久免费网站| 久久综合色老色| 伊人久久大香线蕉综合网站| 久久激情五月丁香伊人| 久久精品中文字幕一区| 国产伊人久久| 精品久久久久中文字| 狠狠色丁香婷婷综合久久来来去| 日韩精品久久久久久| AV无码久久久久不卡网站下载| 久久久久久亚洲AV无码专区| 久久精品一本到99热免费| 久久久久亚洲AV片无码下载蜜桃|